diff options
author | Damien George <damien.p.george@gmail.com> | 2016-05-26 14:58:23 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-05-26 15:47:47 +0100 |
commit | 849eb835f013fccb31530881b8ffae36521bacc4 (patch) | |
tree | ee0812af3d8498dce64bd93f316c1c90bce6e409 /esp8266/ets_alt_task.c | |
parent | 99b14593a64819c07bf065d185844d6012b884ca (diff) | |
download | micropython-849eb835f013fccb31530881b8ffae36521bacc4.tar.gz micropython-849eb835f013fccb31530881b8ffae36521bacc4.zip |
esp8266/ets_alt_task: Don't run ets_loop_iter if irqs are disabled.
ets_loop_iter processes pending tasks, and tasks are considered lower
priority than interrupts, so tasks shouldn't be processed if interrupts
are disabled.
Diffstat (limited to 'esp8266/ets_alt_task.c')
-rw-r--r-- | esp8266/ets_alt_task.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/esp8266/ets_alt_task.c b/esp8266/ets_alt_task.c index 91623f06df..563aeb5acb 100644 --- a/esp8266/ets_alt_task.c +++ b/esp8266/ets_alt_task.c @@ -1,4 +1,5 @@ #include <stdio.h> +#include "xtirq.h" #include "osapi.h" #include "os_type.h" #include "ets_sys.h" @@ -108,6 +109,9 @@ bool ets_post(uint8 prio, os_signal_t sig, os_param_t param) { } bool ets_loop_iter(void) { + if (query_irq() != 0) { + return false; + } //static unsigned cnt; bool progress = false; for (volatile struct task_entry *t = emu_tasks; t < &emu_tasks[MP_ARRAY_SIZE(emu_tasks)]; t++) { |