sim/looper: close interrupt when looper run

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2022-12-19 17:42:39 +08:00 committed by Masayuki Ishikawa
parent 5744c62443
commit ec191d05b6
1 changed files with 7 additions and 0 deletions

View File

@ -162,6 +162,10 @@ static int sim_loop_task(int argc, char **argv)
{ {
while (1) while (1)
{ {
irqstate_t flags = up_irq_save();
sched_lock();
/* Handle UART data availability */ /* Handle UART data availability */
sim_uartloop(); sim_uartloop();
@ -209,6 +213,9 @@ static int sim_loop_task(int argc, char **argv)
foc_dummy_update(); foc_dummy_update();
#endif #endif
sched_unlock();
up_irq_restore(flags);
/* Sleep minimal time, let the idle run */ /* Sleep minimal time, let the idle run */
usleep(USEC_PER_TICK); usleep(USEC_PER_TICK);