Harald Welte | 361ed20 | 2019-02-24 21:15:39 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Code generated from Atmel Start. |
| 3 | * |
| 4 | * This file will be overwritten when reconfiguring your Atmel Start project. |
| 5 | * Please copy examples or other code you want to keep to a separate file or main.c |
| 6 | * to avoid loosing it when reconfiguring. |
| 7 | */ |
| 8 | |
| 9 | #include "atmel_start.h" |
| 10 | #include "stdio_start.h" |
| 11 | |
Kévin Redon | 0c3533f | 2019-04-03 21:00:09 +0200 | [diff] [blame] | 12 | static void UART_debug_rx_cb(const struct usart_async_rings_descriptor *const io_descr) |
Harald Welte | 361ed20 | 2019-02-24 21:15:39 +0100 | [diff] [blame] | 13 | { |
Harald Welte | 361ed20 | 2019-02-24 21:15:39 +0100 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | void stdio_redirect_init(void) |
| 17 | { |
Kévin Redon | 0c3533f | 2019-04-03 21:00:09 +0200 | [diff] [blame] | 18 | usart_async_rings_register_callback(&UART_debug, USART_ASYNC_RXC_CB, UART_debug_rx_cb); // if no callback function is registered receive won't work, even if the callback does nothing |
| 19 | usart_async_rings_enable(&UART_debug); |
Harald Welte | 361ed20 | 2019-02-24 21:15:39 +0100 | [diff] [blame] | 20 | stdio_io_init(&UART_debug.io); |
| 21 | } |