pic32mz: Fix remote_wakeup without OS
Remote wakeup requires 10ms of delay when RESUME bit is toggled. It was covered for OS build. For non-OS build simple delay based on board_millis() is used to wait required amount of time. Without this remote wakup may not work.
This commit is contained in:
parent
976405dea3
commit
168c7095e8
|
@ -163,6 +163,10 @@ void dcd_remote_wakeup(uint8_t rhport)
|
||||||
USB_REGS->POWERbits.RESUME = 1;
|
USB_REGS->POWERbits.RESUME = 1;
|
||||||
#if CFG_TUSB_OS != OPT_OS_NONE
|
#if CFG_TUSB_OS != OPT_OS_NONE
|
||||||
osal_task_delay(10);
|
osal_task_delay(10);
|
||||||
|
#else
|
||||||
|
// TODO: Wait in non blocking mode
|
||||||
|
unsigned cnt = 2000;
|
||||||
|
while (cnt--) __asm__("nop");
|
||||||
#endif
|
#endif
|
||||||
USB_REGS->POWERbits.RESUME = 0;
|
USB_REGS->POWERbits.RESUME = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue