aboutsummaryrefslogtreecommitdiff
path: root/examples/usartecho
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-10-08 21:12:53 +0200
committerKarel Kočí <cynerd@email.cz>2015-10-08 21:12:53 +0200
commit2d4f56d374b1bafc426c230a572fb9b12eafef76 (patch)
tree6049f5cc972fae4ccfc3a730fbc3b95b09cd3e06 /examples/usartecho
parentacdd758e56e28f22846e7d34d87f5533c8682574 (diff)
downloadavr-ioe-2d4f56d374b1bafc426c230a572fb9b12eafef76.tar.gz
avr-ioe-2d4f56d374b1bafc426c230a572fb9b12eafef76.tar.bz2
avr-ioe-2d4f56d374b1bafc426c230a572fb9b12eafef76.zip
Add small readme for uasrtecho example and small tweaks
Diffstat (limited to 'examples/usartecho')
-rw-r--r--examples/usartecho/README.md6
-rw-r--r--examples/usartecho/echo.c1
-rw-r--r--examples/usartecho/makefile5
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