Bugfix: Make redirected stdio write initialize UART

Calling a scanf before the first printf would end up calling serial_getc without initializing the UART.
pull/418/head
Andreas Løve Selvik 2014-07-29 11:27:24 +02:00
parent 68b2f4648f
commit f3de4bc529
1 changed files with 1 additions and 0 deletions

View File

@ -227,6 +227,7 @@ extern "C" int PREFIX(_read)(FILEHANDLE fh, unsigned char *buffer, unsigned int
if (fh < 3) {
// only read a character at a time from stdin
#if DEVICE_SERIAL
if (!stdio_uart_inited) init_serial();
*buffer = serial_getc(&stdio_uart);
#endif
n = 1;