Skip to content

Commit e47447b

Browse files
authored
Merge pull request #3306 from kamtom480/usb_fix
spresense: call usb_background function
2 parents 27f0308 + e2891bc commit e47447b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ports/cxd56/supervisor/port.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
#include "boards/board.h"
3737

3838
#include "supervisor/port.h"
39+
#include "supervisor/background_callback.h"
40+
#include "supervisor/usb.h"
3941
#include "supervisor/shared/tick.h"
4042

4143
#include "common-hal/microcontroller/Pin.h"
@@ -114,13 +116,20 @@ uint32_t port_get_saved_word(void) {
114116
return _ebss;
115117
}
116118

119+
static background_callback_t callback;
120+
static void usb_background_do(void* unused) {
121+
usb_background();
122+
}
123+
117124
volatile bool _tick_enabled;
118125
void board_timerhook(void)
119126
{
120127
// Do things common to all ports when the tick occurs
121128
if (_tick_enabled) {
122129
supervisor_tick();
123130
}
131+
132+
background_callback_add(&callback, usb_background_do, NULL);
124133
}
125134

126135
uint64_t port_get_raw_ticks(uint8_t* subticks) {

0 commit comments

Comments
 (0)