mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
sim/looper: close interrupt when looper run
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user