Skip to content

Commit

Permalink
nrf/mpconfigport: Call tud_task() in MICROPY_EVENT_POLL_HOOK.
Browse files Browse the repository at this point in the history
So that the interrupt character can interrupt a long-running loop, like a
sleep.
  • Loading branch information
robert-hh authored and dpgeorge committed Jul 16, 2022
1 parent c985a0b commit be6f0f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ports/nrf/mpconfigport.h
Expand Up @@ -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(); \
Expand Down

0 comments on commit be6f0f3

Please sign in to comment.