File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
targets/TARGET_Cypress/TARGET_PSOC6 Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1717
1818#include " cy_usb_phy_hw.h"
1919#include " mbed_assert.h"
20+ #include " mbed_power_mgmt.h"
2021
2122#if defined(DEVICE_USBDEVICE)
2223
@@ -64,6 +65,10 @@ void USBPhyHw::init(USBPhyEvents *events)
6465 // Initialize instance to access class data
6566 instance = this ;
6667
68+ if (this ->events == NULL ) {
69+ sleep_manager_lock_deep_sleep ();
70+ }
71+
6772 // Store events
6873 instance->events = events;
6974
@@ -176,6 +181,12 @@ void USBPhyHw::usb_dev_execute_ep_callbacks(void)
176181void USBPhyHw::deinit ()
177182{
178183 cyhal_usb_dev_free (&obj);
184+
185+ if (events != NULL ) {
186+ sleep_manager_unlock_deep_sleep ();
187+ }
188+
189+ events = NULL ;
179190}
180191
181192bool USBPhyHw::powered ()
You can’t perform that action at this time.
0 commit comments