diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-08-20 11:23:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-20 11:23:16 -0700 |
| commit | e47447ba592676c2ab57a4ae7c2aed4f7bd10004 (patch) | |
| tree | 1d43a7a2296f36766e7c1c74d7e9d393a7665246 | |
| parent | 27f0308662e070d6565af74791a4e5c55822b01d (diff) | |
| parent | e2891bc7d41a06dcee30daf521cd8693d38402bb (diff) | |
Merge pull request #3306 from kamtom480/usb_fix
spresense: call usb_background function
| -rw-r--r-- | ports/cxd56/supervisor/port.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index a40d31faf..bbd864f90 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -36,6 +36,8 @@ #include "boards/board.h" #include "supervisor/port.h" +#include "supervisor/background_callback.h" +#include "supervisor/usb.h" #include "supervisor/shared/tick.h" #include "common-hal/microcontroller/Pin.h" @@ -114,6 +116,11 @@ uint32_t port_get_saved_word(void) { return _ebss; } +static background_callback_t callback; +static void usb_background_do(void* unused) { + usb_background(); +} + volatile bool _tick_enabled; void board_timerhook(void) { @@ -121,6 +128,8 @@ void board_timerhook(void) if (_tick_enabled) { supervisor_tick(); } + + background_callback_add(&callback, usb_background_do, NULL); } uint64_t port_get_raw_ticks(uint8_t* subticks) { |
