Merge pull request #2202 from Rocky04/patch-4

Invoke unmounted state on configuration reset
This commit is contained in:
Ha Thach
2023-08-09 20:48:26 +07:00
committed by GitHub
21 changed files with 46 additions and 25 deletions

View File

@@ -179,7 +179,14 @@ void tud_suspend_cb(bool remote_wakeup_en)
// Invoked when usb bus is resumed
void tud_resume_cb(void)
{
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
if (tud_mounted())
{
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
}
else
{
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), 0);
}
}
//--------------------------------------------------------------------+