Skip to content

Commit 4f8ccb1

Browse files
committed
move yield() to main.cpp
1 parent b92b61b commit 4f8ccb1

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

cores/arduino/TinyUSB/Adafruit_TinyUSB_Core.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,6 @@ uint8_t Adafruit_USBD_Device::getSerialDescriptor(uint16_t* serial_str)
100100
return sizeof(raw_id)*2;
101101
}
102102

103-
104-
extern "C"
105-
{
106-
107-
// running tinyusb background task if yield()
108-
void yield(void)
109-
{
110-
tud_task();
111-
tud_cdc_write_flush();
112-
}
113-
114-
}
115-
116103
//--------------------------------------------------------------------+
117104
// Helpers
118105
//--------------------------------------------------------------------+

cores/arduino/main.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,14 @@ int main( void )
5959

6060
return 0;
6161
}
62+
63+
#if defined(USE_TINYUSB)
64+
65+
// run TinyUSB background task when yield()
66+
extern "C" void yield(void)
67+
{
68+
tud_task();
69+
tud_cdc_write_flush();
70+
}
71+
72+
#endif

0 commit comments

Comments
 (0)