From 8fa9db4244f4ee33aa47561c569edfa62fe37928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 11 Oct 2015 23:21:07 +0200 Subject: Fixes in USART and changes in ave-ioe.mk --- avr-ioe.mk | 6 +++--- examples/spiblink/makefile | 3 ++- examples/usartecho/makefile | 1 + src/usart.c | 6 +++--- usart.h | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/avr-ioe.mk b/avr-ioe.mk index 1248f11..34967a5 100644 --- a/avr-ioe.mk +++ b/avr-ioe.mk @@ -29,8 +29,8 @@ endif ifndef MMCU $(error Pleade define MMCU variable in makefile before including avr-ioe.mk) endif -IOE_CFLAGS ?= -Os -ffunction-sections -fdata-sections -fshort-enums -Wall -IOE_CFLAGS += -DF_CPU=$(F_CPU) -mmcu=$(MMCU) +IOE_CFLAGS ?= -Os -ffunction-sections -fdata-sections -fshort-enums -Wall \ + -DF_CPU=$(F_CPU) -mmcu=$(MMCU) IOE_GCC ?= avr-gcc $(IOE_OBJ): %.o: %.c @@ -40,7 +40,7 @@ $(IOE_DEP): %.d: %.c $(IOE_GCC) -MM -MG -MT '$*.o $@' $(IOE_CFLAGS) -c -o $@ $< .PHONY: ioeclean -ioeclean: +ioeclean:: $(RM) $(IOE_OBJ) $(RM) $(IOE_DEP) diff --git a/examples/spiblink/makefile b/examples/spiblink/makefile index a831f86..bb3b94a 100644 --- a/examples/spiblink/makefile +++ b/examples/spiblink/makefile @@ -3,7 +3,8 @@ MAKEFLAGS += --no-builtin-rules MMCU = atmega328p F_CPU = 16000000L IOE_PREFIX = ../.. -IOE_CFLAGS ?= -Os -ffunction-sections -fdata-sections -fshort-enums -g -Wall +IOE_CFLAGS ?= -Os -ffunction-sections -fdata-sections -fshort-enums -g -Wall \ + -DF_CPU=$(F_CPU) -mmcu=$(MMCU) .PHONY: all all: master.hex slave.hex diff --git a/examples/usartecho/makefile b/examples/usartecho/makefile index 48a713c..fa10cd2 100644 --- a/examples/usartecho/makefile +++ b/examples/usartecho/makefile @@ -4,6 +4,7 @@ MMCU = atmega328p F_CPU = 16000000L IOE_PREFIX = ../.. IOE_CFLAGS = -Os -ffunction-sections -fdata-sections -fshort-enums -Wall \ + -DF_CPU=$(F_CPU) -mmcu=$(MMCU) \ -DCONFIG_IOE_USART_OUTBUFFER_SIZE=64 \ -DCONFIG_IOE_USART_OUTBUFFER_MODE=0 \ -DCONFIG_IOE_USART_BAUD=115200 \ diff --git a/src/usart.c b/src/usart.c index dca5878..5dd14b3 100644 --- a/src/usart.c +++ b/src/usart.c @@ -185,12 +185,12 @@ FILE *usart_async_open(void) { usart_init_async(); #ifdef CONFIG_IOE_USART_OUTFILE #ifdef CONFIG_IOE_USART_INFILE - return fdevopen(spiput, spiget); + return fdevopen(usartput, usartget); #else - return fdevopen(spiput, 0); + return fdevopen(usartput, 0); #endif #else - return fdevopen(0, spiget); + return fdevopen(0, usartget); #endif } #endif diff --git a/usart.h b/usart.h index 8ff0773..fec7a1a 100644 --- a/usart.h +++ b/usart.h @@ -49,7 +49,7 @@ uint8_t usart_inbuffered(void); uint8_t usart_outbuffered(void); #endif #if (defined CONFIG_IOE_USART_INFILE) || (defined CONFIG_IOE_USART_OUTFILE) -FILE *spi_open(void); +FILE *usart_async_open(void); #endif // Following function must be user defined if relevant buffers not used. -- cgit v1.2.3