mirror of https://github.com/ARMmbed/mbed-os.git
Lock sleep when USB is initialized
Added logic to lock deep sleep when USB is initialized to prevent malfunctioning. This is consistent with the other drivers. See PR ARMmbed/mbed-os#9879pull/10689/head
parent
e006666527
commit
cc4d8e6d75
|
@ -70,6 +70,14 @@ USBPhyHw::~USBPhyHw()
|
||||||
void USBPhyHw::init(USBPhyEvents *events)
|
void USBPhyHw::init(USBPhyEvents *events)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Disable the USBD interrupts
|
||||||
|
// Interrupts will be reenabled by the Nordic driver
|
||||||
|
NRFX_IRQ_DISABLE(USBD_IRQn);
|
||||||
|
|
||||||
|
if(this->events == NULL) {
|
||||||
|
sleep_manager_lock_deep_sleep();
|
||||||
|
}
|
||||||
|
|
||||||
this->events = events;
|
this->events = events;
|
||||||
|
|
||||||
ret_code_t ret;
|
ret_code_t ret;
|
||||||
|
@ -125,6 +133,10 @@ void USBPhyHw::deinit()
|
||||||
// Disable the power peripheral driver
|
// Disable the power peripheral driver
|
||||||
nrfx_power_uninit();
|
nrfx_power_uninit();
|
||||||
|
|
||||||
|
if(this->events != NULL) {
|
||||||
|
sleep_manager_unlock_deep_sleep();
|
||||||
|
}
|
||||||
|
|
||||||
// Clear the instance pointer
|
// Clear the instance pointer
|
||||||
instance = 0;
|
instance = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue