summaryrefslogtreecommitdiff
path: root/supervisor/shared/autoreload.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2020-03-06 18:15:16 -0800
committerScott Shawcroft <scott@tannewt.org>2020-03-13 11:12:31 -0700
commit418333979ae007b28855079c64ee3c65f76ecbc7 (patch)
treedea0de8db2b059e6de6abc864df29b0005ac5e1c /supervisor/shared/autoreload.c
parent6f60afe8c521011d1a2d34a2632295b483a8cee3 (diff)
Fix autoreload, neopixel, monotonic_ns and sleep w/o SD
Diffstat (limited to 'supervisor/shared/autoreload.c')
-rw-r--r--supervisor/shared/autoreload.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/supervisor/shared/autoreload.c b/supervisor/shared/autoreload.c
index a6212c1a9..bc818e6b0 100644
--- a/supervisor/shared/autoreload.c
+++ b/supervisor/shared/autoreload.c
@@ -28,6 +28,7 @@
#include "py/mphal.h"
#include "py/reload.h"
+#include "supervisor/shared/tick.h"
static volatile uint32_t autoreload_delay_ms = 0;
static bool autoreload_enabled = false;
@@ -43,6 +44,7 @@ inline void autoreload_tick() {
!autoreload_suspended && !reload_requested) {
mp_raise_reload_exception();
reload_requested = true;
+ supervisor_disable_tick();
}
autoreload_delay_ms--;
}
@@ -69,6 +71,9 @@ inline bool autoreload_is_enabled() {
}
void autoreload_start() {
+ if (autoreload_delay_ms == 0) {
+ supervisor_enable_tick();
+ }
autoreload_delay_ms = CIRCUITPY_AUTORELOAD_DELAY_MS;
}