diff --git a/arch/sim/src/up_head.c b/arch/sim/src/up_head.c index f7f5374e3ca..9ef650f7d24 100644 --- a/arch/sim/src/up_head.c +++ b/arch/sim/src/up_head.c @@ -96,7 +96,7 @@ int main(int argc, char **argv, char **envp) /* Restore the original terminal mode and return the exit code */ - simuart_teriminate(); + simuart_terminate(); return g_exitcode; } diff --git a/arch/sim/src/up_idle.c b/arch/sim/src/up_idle.c index 2cfd5a5b8c1..7d531e32f4c 100644 --- a/arch/sim/src/up_idle.c +++ b/arch/sim/src/up_idle.c @@ -93,7 +93,7 @@ void up_idle(void) * should not matter which, however. */ - static volatile spinlock_t lock; + static volatile spinlock_t lock = SP_UNLOCKED; /* The one that gets the lock is the one that executes the IDLE operations */ @@ -130,7 +130,6 @@ void up_idle(void) } #endif - #ifdef CONFIG_NET_ETHERNET /* Run the network if enabled */ diff --git a/arch/sim/src/up_internal.h b/arch/sim/src/up_internal.h index 4f723c1599d..214e337a6e8 100644 --- a/arch/sim/src/up_internal.h +++ b/arch/sim/src/up_internal.h @@ -237,7 +237,7 @@ void simuart_start(void); int simuart_putc(int ch); int simuart_getc(void); bool simuart_checkc(void); -void simuart_teriminate(void); +void simuart_terminate(void); /* up_uartwait.c **********************************************************/ diff --git a/arch/sim/src/up_simuart.c b/arch/sim/src/up_simuart.c index 248848a2068..5e3518f3229 100644 --- a/arch/sim/src/up_simuart.c +++ b/arch/sim/src/up_simuart.c @@ -89,7 +89,6 @@ void simuart_wait(void); static struct termios g_cooked; - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -140,12 +139,11 @@ static void *simuart_thread(void *arg) /* Check for failures (but don't do anything) */ - if (nread == 1) + for (; nread > 0; nread--) { #ifdef CONFIG_SIM_UART_DATAPOST sched_lock(); #endif - /* Get the index to the next slot in the UART buffer */ prev = g_uarthead; @@ -276,7 +274,7 @@ int simuart_getc(void) int ch; /* Locking the scheduler should eliminate the race conditions in the - * unlikely case of mutliple reading threads. + * unlikely case of multiple reading threads. */ sched_lock(); @@ -319,10 +317,10 @@ bool simuart_checkc(void) } /**************************************************************************** - * Name: simuart_teriminate + * Name: simuart_terminate ****************************************************************************/ -void simuart_teriminate(void) +void simuart_terminate(void) { /* Restore the original terminal mode */