summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobert-hh <robert@hammelrath.com>2022-07-09 08:54:29 +0200
committerDamien George <damien@micropython.org>2022-07-17 00:12:34 +1000
commitbe6f0f3b3b99820d8aef835a8c2af1a1baaed049 (patch)
treebbe8ca4da401749ed6147fdb3a6f420c5ceb1b3e
parentc985a0b5148cf51c400a53b692f570daf89d9810 (diff)
nrf/mpconfigport: Call tud_task() in MICROPY_EVENT_POLL_HOOK.
So that the interrupt character can interrupt a long-running loop, like a sleep.
-rw-r--r--ports/nrf/mpconfigport.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h
index dc7c3b1ea..0698a52ce 100644
--- a/ports/nrf/mpconfigport.h
+++ b/ports/nrf/mpconfigport.h
@@ -346,8 +346,15 @@ typedef long mp_off_t;
/* micro:bit root pointers */ \
void *async_data[2]; \
+#if MICROPY_HW_USB_CDC
+#define MICROPY_HW_USBDEV_TASK_HOOK extern void tud_task(void); tud_task();
+#else
+#define MICROPY_HW_USBDEV_TASK_HOOK ;
+#endif
+
#define MICROPY_EVENT_POLL_HOOK \
do { \
+ MICROPY_HW_USBDEV_TASK_HOOK \
extern void mp_handle_pending(bool); \
mp_handle_pending(true); \
__WFI(); \