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