diff options
Diffstat (limited to 'examples/usartecho')
-rw-r--r-- | examples/usartecho/README.md | 6 | ||||
-rw-r--r-- | examples/usartecho/echo.c | 1 | ||||
-rw-r--r-- | examples/usartecho/makefile | 5 |
3 files changed, 7 insertions, 5 deletions
diff --git a/examples/usartecho/README.md b/examples/usartecho/README.md new file mode 100644 index 0000000..e476649 --- /dev/null +++ b/examples/usartecho/README.md @@ -0,0 +1,6 @@ +This is example for UART. It is implementing simple echo functionality. +All input send on USART is send back. + +For compilation run `make` and then flash usart.hex to your MCU. +In default is as target set ATmega328p with 16MHz clock. If you want build for +different speed or controller, change MMCU and F_CPU variable in `makefile`. diff --git a/examples/usartecho/echo.c b/examples/usartecho/echo.c index 4d978f7..4ba9364 100644 --- a/examples/usartecho/echo.c +++ b/examples/usartecho/echo.c @@ -9,7 +9,6 @@ void rec(uint8_t data) { } int main() { - DDRB |= _BV(DDB1) | _BV(DDB2); usart_init_uart(); SREG |= _BV(7); usart_send('a'); diff --git a/examples/usartecho/makefile b/examples/usartecho/makefile index 343addc..7475127 100644 --- a/examples/usartecho/makefile +++ b/examples/usartecho/makefile @@ -3,16 +3,13 @@ MAKEFLAGS += --no-builtin-rules MMCU = atmega328p F_CPU = 16000000L IOE_PREFIX = ../.. -IOE_CFLAGS = -Os -ffunction-sections -fdata-sections -fshort-enums -Wall -g \ +IOE_CFLAGS = -Os -ffunction-sections -fdata-sections -fshort-enums -Wall \ -DCONFIG_IOE_USART_OUTBUFFER_SIZE=64 \ -DCONFIG_IOE_USART_OUTBUFFER_MODE=0 all: usart.hex @echo Flash usart.hex to chip -install: usart.hex - # TODO - clean: ioeclean $(RM) echo.o $(RM) usart.elf usart.hex |