Merge commit 'd79ddb8ee70905668bdd4b4614b2ba03ad545fd4'

This commit is contained in:
Sebastian 2016-11-21 22:53:08 +01:00
commit b74590b99f
6 changed files with 14 additions and 12 deletions

View File

@ -1,3 +1,4 @@
-I../sss7core
-I/usr/avr/include
-D__AVR_ATmega8__
-DF_CPU=16000000

View File

@ -4,8 +4,8 @@ ISPPORT ?= /dev/kaboard
VERSION = 0.1
HEADERS = sss7.h uart.h timer.h
SRC = main.c sss7.c uart.c timer.c
HEADERS = ../sss7core/sss7.h uart.h timer.h
SRC = main.c ../sss7core/sss7.c uart.c timer.c
TARGET = sss7
OBJDIR = bin
@ -16,7 +16,7 @@ SIZE = avr-size
OBJ = $(SRC:%.c=$(OBJDIR)/$(AVRMCU)/%.o)
CFLAGS = -Os -Wall -Wstrict-prototypes
CFLAGS = -I ../sss7core/ -Os -Wall -Wstrict-prototypes
CFLAGS += -ffunction-sections -fdata-sections
CFLAGS += -fshort-enums -fpack-struct -funsigned-char -funsigned-bitfields
CFLAGS += -mmcu=$(AVRMCU) -DF_CPU=$(F_CPU)UL -DVERSION=$(VERSION)

View File

@ -25,7 +25,14 @@ void uart_init(void) {
UCSRB |= (1 << TXCIE) | (1 << RXCIE); // enable tx and rx interrupts
}
uint8_t uart_get_byte(void) {
uint8_t byte = UDR;
return byte;
}
void uart_put_byte(uint8_t byte) {
UDR = byte;
}
ISR(USART_RXC_vect) {
sss7_process_rx();
}

View File

@ -17,13 +17,6 @@
void uart_init(void);
static inline uint8_t uart_get_byte(void) {
uint8_t byte = UDR;
return byte;
}
static inline void uart_put_byte(uint8_t byte) {
UDR = byte;
}
#endif

View File

@ -2,8 +2,6 @@
#include <string.h>
#include "uart.h"
volatile enum sss7State sss7_state;
uint8_t sss7_rx_buffer[SSS7_RX_BUFFER_COUNT][SSS7_PAYLOAD_SIZE];

View File

@ -31,6 +31,9 @@ void sss7_process_rx(void);
void sss7_process_tx(void);
void sss7_process_ticks(uint16_t ticks);
extern void uart_put_byte(uint8_t byte);
extern uint8_t uart_get_byte(void);
void sss7_init(void);