Skip to content

Commit be6f0f3

Browse files
robert-hhdpgeorge
authored andcommitted
nrf/mpconfigport: Call tud_task() in MICROPY_EVENT_POLL_HOOK.
So that the interrupt character can interrupt a long-running loop, like a sleep.
1 parent c985a0b commit be6f0f3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ports/nrf/mpconfigport.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,15 @@ typedef long mp_off_t;
346346
/* micro:bit root pointers */ \
347347
void *async_data[2]; \
348348

349+
#if MICROPY_HW_USB_CDC
350+
#define MICROPY_HW_USBDEV_TASK_HOOK extern void tud_task(void); tud_task();
351+
#else
352+
#define MICROPY_HW_USBDEV_TASK_HOOK ;
353+
#endif
354+
349355
#define MICROPY_EVENT_POLL_HOOK \
350356
do { \
357+
MICROPY_HW_USBDEV_TASK_HOOK \
351358
extern void mp_handle_pending(bool); \
352359
mp_handle_pending(true); \
353360
__WFI(); \

0 commit comments

Comments
 (0)