From e99d05582f06833c600c48b3220a1ff411bc2f31 Mon Sep 17 00:00:00 2001 From: Kelvin Lawson Date: Sun, 20 Mar 2016 22:44:25 +0000 Subject: [PATCH] ARM reent stdout: Set unbuffered. --- ports/arm/atomport.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ports/arm/atomport.c b/ports/arm/atomport.c index 3154fa7..1383a8a 100644 --- a/ports/arm/atomport.c +++ b/ports/arm/atomport.c @@ -72,12 +72,13 @@ static void thread_shell (void) /* Get the TCB of the thread being started */ curr_tcb = atomCurrentContext(); - /** - * Open a stdout file descriptor so that the thread has its own stdout. - * In theory threads could open stdout to different output drivers - * if syscalls.s supported different output write functions. - */ - stdout = fopen ("/debuguart", "w"); + /** + * Open a stdout file descriptor so that the thread has its own stdout. + * In theory threads could open stdout to different output drivers + * if syscalls.s supported different output write functions. + */ + stdout = fopen ("/debuguart", "w"); + setvbuf (stdout, 0, _IONBF, 0); /** * Enable interrupts - these will not be enabled when a thread