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 17
17
18
18
#include " cy_usb_phy_hw.h"
19
19
#include " mbed_assert.h"
20
+ #include " mbed_power_mgmt.h"
20
21
21
22
#if defined(DEVICE_USBDEVICE)
22
23
@@ -64,6 +65,10 @@ void USBPhyHw::init(USBPhyEvents *events)
64
65
// Initialize instance to access class data
65
66
instance = this ;
66
67
68
+ if (this ->events == NULL ) {
69
+ sleep_manager_lock_deep_sleep ();
70
+ }
71
+
67
72
// Store events
68
73
instance->events = events;
69
74
@@ -176,6 +181,12 @@ void USBPhyHw::usb_dev_execute_ep_callbacks(void)
176
181
void USBPhyHw::deinit ()
177
182
{
178
183
cyhal_usb_dev_free (&obj);
184
+
185
+ if (events != NULL ) {
186
+ sleep_manager_unlock_deep_sleep ();
187
+ }
188
+
189
+ events = NULL ;
179
190
}
180
191
181
192
bool USBPhyHw::powered ()
You can’t perform that action at this time.
0 commit comments