File tree 4 files changed +13
-7
lines changed
4 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 31
31
// --------------------------------------------------------------------+
32
32
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
33
33
// --------------------------------------------------------------------+
34
+ extern " C"
35
+ {
34
36
35
37
void TinyUSB_Device_Init (uint8_t rhport)
36
38
{
@@ -39,6 +41,8 @@ void TinyUSB_Device_Init(uint8_t rhport)
39
41
40
42
void TinyUSB_Device_Task (void )
41
43
{
44
+ USBDevice.task ();
45
+ }
42
46
43
47
}
44
48
Original file line number Diff line number Diff line change 33
33
// Should be called by BSP Core to initialize, process task
34
34
// Weak function allow compile arduino core before linking with this library
35
35
//--------------------------------------------------------------------+
36
+ #ifdef __cplusplus
37
+ extern "C" {
38
+ #endif
36
39
37
40
// Called by core/sketch to initialize usb device hardware and stack
38
41
// This also initialize Serial as CDC device
@@ -41,6 +44,10 @@ void TinyUSB_Device_Init(uint8_t rhport) __attribute__((weak));
41
44
// Called by core/sketch to handle device event
42
45
void TinyUSB_Device_Task (void ) __attribute__((weak ));
43
46
47
+ #ifdef __cplusplus
48
+ }
49
+ #endif
50
+
44
51
//--------------------------------------------------------------------+
45
52
// Port API
46
53
// Must be implemented by each BSP core/platform
Original file line number Diff line number Diff line change @@ -248,6 +248,8 @@ void Adafruit_USBD_Device::task(void)
248
248
tud_task ();
249
249
250
250
#if CFG_TUSB_OS == OPT_OS_NONE || CFG_TUSB_OS == OPT_OS_PICO
251
+ // flush Serial if we don't use RTOS TODO multiple CDCs
252
+ tud_cdc_n_write_flush (0 );
251
253
#endif
252
254
}
253
255
Original file line number Diff line number Diff line change @@ -52,13 +52,6 @@ void USB_Handler(void) { tud_int_handler(0); }
52
52
53
53
#endif
54
54
55
- // run TinyUSB background task when yield()
56
- void yield (void )
57
- {
58
- tud_task ();
59
- tud_cdc_write_flush ();
60
- }
61
-
62
55
} // extern C
63
56
64
57
You can’t perform that action at this time.
0 commit comments