fix issue nrf52840 not reset properly when upgrading bootloader+sd combo

- root cause tusb_task()/cdc task is called when usb is not inited (in
case of sd upgrade)
This commit is contained in:
hathach
2018-12-20 00:50:14 +07:00
parent fc13287837
commit 5c38bc8957
3 changed files with 16 additions and 3 deletions

View File

@ -128,8 +128,9 @@ static void wait_for_events(void)
app_sched_execute();
#ifdef NRF52840_XXAA
// usb is not enabled in OTA
if ( !is_ota() )
// skip if usb is not inited ( e.g OTA / finializing sd/bootloader )
extern bool usb_inited(void);
if ( usb_inited() )
{
tusb_task();
tud_cdc_write_flush();