fixed uart_isr example

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

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

@ -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);
} }

Loading…
Cancel
Save