Skip to content

Commit

Permalink
cores: sync with tinyusb lib latest change
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxwelltoo committed Sep 4, 2023
1 parent 9e8beb1 commit f6bb825
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
11 changes: 11 additions & 0 deletions cores/arduino/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ void SysTick_DefaultHandler(void)
tickReset();
}

#if defined(USE_TINYUSB)

// run TinyUSB background task when yield()
void yield(void)
{
TinyUSB_Device_Task();
TinyUSB_Device_FlushCDC();
}

#endif

#ifdef __cplusplus
}
#endif
3 changes: 1 addition & 2 deletions cores/arduino/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ int main(void)
delay(1);

#if defined(USE_TINYUSB)
Adafruit_TinyUSB_Core_init();
tinyusb_task();
TinyUSB_Device_Init(0);
#elif defined(USBCON)
USBDevice.init();
USBDevice.attach();
Expand Down
2 changes: 1 addition & 1 deletion variants/XIAO_m0/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,4 @@ extern Uart Serial1;
#define SERIAL_PORT_HARDWARE Serial1
#define SERIAL_PORT_HARDWARE_OPEN Serial1

#endif SerialUSB
#endif /* NO_USART_INTERFACE */

0 comments on commit f6bb825

Please sign in to comment.