move yield() to main.cpp

This commit is contained in:
hathach 2019-12-19 23:54:15 +07:00
parent b92b61b36f
commit 4f8ccb165c
No known key found for this signature in database
GPG key ID: 2FA891220FBFD581
2 changed files with 11 additions and 13 deletions

View file

@ -100,19 +100,6 @@ uint8_t Adafruit_USBD_Device::getSerialDescriptor(uint16_t* serial_str)
return sizeof(raw_id)*2;
}
extern "C"
{
// running tinyusb background task if yield()
void yield(void)
{
tud_task();
tud_cdc_write_flush();
}
}
//--------------------------------------------------------------------+
// Helpers
//--------------------------------------------------------------------+

View file

@ -59,3 +59,14 @@ int main( void )
return 0;
}
#if defined(USE_TINYUSB)
// run TinyUSB background task when yield()
extern "C" void yield(void)
{
tud_task();
tud_cdc_write_flush();
}
#endif