spresense: call usb_background function

This commit is contained in:
Kamil Tomaszewski 2020-08-20 16:21:25 +02:00
parent 837abd6da0
commit e2891bc7d4
1 changed files with 9 additions and 0 deletions

View File

@ -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) {