diff --git a/arch/sim/src/sim/sim_initialize.c b/arch/sim/src/sim/sim_initialize.c index 1eb23e5879..5b6a267ff4 100644 --- a/arch/sim/src/sim/sim_initialize.c +++ b/arch/sim/src/sim/sim_initialize.c @@ -162,6 +162,10 @@ static int sim_loop_task(int argc, char **argv) { while (1) { + irqstate_t flags = up_irq_save(); + + sched_lock(); + /* Handle UART data availability */ sim_uartloop(); @@ -209,6 +213,9 @@ static int sim_loop_task(int argc, char **argv) foc_dummy_update(); #endif + sched_unlock(); + up_irq_restore(flags); + /* Sleep minimal time, let the idle run */ usleep(USEC_PER_TICK);