fixed uart_isr example

pull/1/head
Ondřej Hruška 9 years ago
parent a0425725b9
commit 5a3d6a5f5e
  1. 2
      examples/Makefile
  2. 11
      examples/uart_isr.c

@ -11,7 +11,7 @@ EFUSE = 0x05
## === Source files ===
# Main C file
MAIN = sonar_to_lcd.c
MAIN = uart_isr.c
# Extra C files in this folder
LOCAL_SOURCE =

@ -10,6 +10,7 @@
#include <stdlib.h>
#include "lib/uart.h"
#include "lib/stream.h"
// UART receive interrupt vector
@ -18,10 +19,10 @@ ISR(USART_RX_vect)
uint8_t c = uart_rx();
// print character and it's code
uart_putc(c);
uart_putc(' ');
uart_putu(c);
uart_nl();
uart_tx(c);
uart_tx(' ');
put_u8(uart, c);
put_nl(uart);
}
@ -35,7 +36,7 @@ void main()
sei();
// Greeter string
uart_puts_pgm(PSTR("UART receiver with ISR\r\n"));
put_str_P(uart, PSTR("UART receiver with ISR\r\n"));
while(1);
}

Loading…
Cancel
Save