From c2e3541c05c801708f1a8ef413d3554f7d8ef8b9 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Sun, 11 Oct 2015 09:21:30 +1100 Subject: [PATCH] Disable default line-buffering of stdout As discussed in #52. Application can re-enable buffering on stdout with setbuf() or setbuf() --- core/app_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/app_main.c b/core/app_main.c index 316cb6d..a710c77 100644 --- a/core/app_main.c +++ b/core/app_main.c @@ -431,6 +431,8 @@ static void user_start_phase2(void) { phy_info = malloc(PHY_INFO_SIZE); sdk_spi_flash_read(sdk_flashchip.chip_size - sdk_flashchip.sector_size * 4, (uint32_t *)phy_info, PHY_INFO_SIZE); + // Disable default buffering on stdout + setbuf(stdout, NULL); // Wait for UARTs to finish sending anything in their queues. uart_flush_txfifo(0); uart_flush_txfifo(1);