usbd add connected, suspended, remote_wakeup

- remove use of osal_queue_reset
This commit is contained in:
hathach
2019-03-30 02:26:15 +07:00
parent 28610198df
commit 93a853cd5b
8 changed files with 85 additions and 56 deletions

View File

@@ -38,7 +38,7 @@
/* Blink pattern
* - 250 ms : device not mounted
* - 1000 ms : device mounted
* - 2000 ms : device is suspended
* - 2500 ms : device is suspended
*/
static uint32_t blink_interval_ms = 250;
@@ -210,6 +210,18 @@ void tud_umount_cb(void)
blink_interval_ms = 250;
}
// Invoked when device is suspended
void tud_suspend_cb(bool remote_wakeup_en)
{
(void) remote_wakeup_en;
blink_interval_ms = 2500;
}
void tud_resume_cb(void)
{
blink_interval_ms = 1000;
}
//--------------------------------------------------------------------+
// BLINKING TASK
//--------------------------------------------------------------------+