From 2d4f56d374b1bafc426c230a572fb9b12eafef76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 8 Oct 2015 21:12:53 +0200 Subject: Add small readme for uasrtecho example and small tweaks --- examples/usartecho/README.md | 6 ++++++ examples/usartecho/echo.c | 1 - examples/usartecho/makefile | 5 +---- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 examples/usartecho/README.md 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 -- cgit v1.2.3