fixed uart_isr example
This commit is contained in:
+1
-1
@@ -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 =
|
||||
|
||||
|
||||
+6
-5
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user