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>
This commit is contained in:
Damien George
2021-04-25 22:28:55 +10:00
parent 916c3fd23f
commit d120859857
8 changed files with 90 additions and 1 deletions

View File

@@ -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"};