summaryrefslogtreecommitdiff
path: root/ports/zephyr/main.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-04-25 22:28:55 +1000
committerDamien George <damien@micropython.org>2021-04-30 15:32:16 +1000
commitd120859857e9e34bded146977f18a2be8c53ce7b (patch)
treeae79f11bbe0def20cd192139e881250a5d4d588d /ports/zephyr/main.c
parent916c3fd23fc4b636a8007525c3bd6308d01509d0 (diff)
zephyr: Run scheduled callbacks at REPL and during mp_hal_delay_ms.
And ctrl-C can now interrupt a time.sleep call. This uses Zephyr's k_poll API to wait efficiently for an event signal, and an optional semaphore. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'ports/zephyr/main.c')
-rw-r--r--ports/zephyr/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ports/zephyr/main.c b/ports/zephyr/main.c
index 74785cc83..f8ec0a0d2 100644
--- a/ports/zephyr/main.c
+++ b/ports/zephyr/main.c
@@ -45,6 +45,7 @@
#include "py/runtime.h"
#include "py/repl.h"
#include "py/gc.h"
+#include "py/mphal.h"
#include "py/stackctrl.h"
#include "lib/utils/pyexec.h"
#include "lib/mp-readline/readline.h"
@@ -123,6 +124,7 @@ int real_main(void) {
mp_stack_set_limit(CONFIG_MAIN_STACK_SIZE - 512);
init_zephyr();
+ mp_hal_init();
#ifdef TEST
static const char *argv[] = {"test"};