summaryrefslogtreecommitdiff
path: root/ports/atmel-samd/background.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/atmel-samd/background.c')
-rw-r--r--ports/atmel-samd/background.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ports/atmel-samd/background.c b/ports/atmel-samd/background.c
index 099cb8b23..94763bc43 100644
--- a/ports/atmel-samd/background.c
+++ b/ports/atmel-samd/background.c
@@ -29,11 +29,15 @@
#include "tick.h"
#include "supervisor/usb.h"
+#include "py/runtime.h"
#include "shared-module/displayio/__init__.h"
#include "shared-module/network/__init__.h"
+#include "supervisor/shared/stack.h"
volatile uint64_t last_finished_tick = 0;
+bool stack_ok_so_far = true;
+
void run_background_tasks(void) {
#if (defined(SAMD21) && defined(PIN_PA02)) || defined(SAMD51)
audio_dma_background();
@@ -41,6 +45,7 @@ void run_background_tasks(void) {
#ifdef CIRCUITPY_DISPLAYIO
displayio_refresh_display();
#endif
+
#if MICROPY_PY_NETWORK
network_module_background();
#endif
@@ -49,6 +54,12 @@ void run_background_tasks(void) {
last_finished_tick = ticks_ms;
}
+void run_background_vm_tasks(void) {
+ assert_heap_ok();
+ run_background_tasks();
+ assert_heap_ok();
+}
+
bool background_tasks_ok(void) {
return ticks_ms - last_finished_tick < 1000;
}