summaryrefslogtreecommitdiff
path: root/ports/cxd56
diff options
context:
space:
mode:
authorKamil Tomaszewski <kamil.tomaszewski@sony.com>2020-08-20 16:21:25 +0200
committerKamil Tomaszewski <kamil.tomaszewski@sony.com>2020-08-20 16:21:25 +0200
commite2891bc7d41a06dcee30daf521cd8693d38402bb (patch)
tree7ad448aa1d7b703ee765d31672018c7582e9edc7 /ports/cxd56
parent837abd6da072a55f3c46d62b013690a12e0ee262 (diff)
spresense: call usb_background function
Diffstat (limited to 'ports/cxd56')
-rw-r--r--ports/cxd56/supervisor/port.c9
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) {