File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
targets/TARGET_Cypress/TARGET_PSOC6 Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ class PwmOut {
68
68
~PwmOut ()
69
69
{
70
70
core_util_critical_section_enter ();
71
+ pwmout_free (&_pwm);
71
72
unlock_deep_sleep ();
72
73
core_util_critical_section_exit ();
73
74
}
Original file line number Diff line number Diff line change @@ -235,9 +235,13 @@ void pwmout_init(pwmout_t *obj, PinName pin)
235
235
236
236
void pwmout_free (pwmout_t * obj )
237
237
{
238
- /* Does nothing because it is not called in the MBED PWMOUT driver
239
- * destructor. The pwmout_init handles multiple calls of constructor.
240
- */
238
+ #if DEVICE_SLEEP && DEVICE_LPTICKER
239
+ if (!Cy_SysPm_UnregisterCallback (& obj -> pm_callback_handler )) {
240
+ error ("PM callback unregistration failed!" );
241
+ }
242
+ #endif
243
+ Cy_TCPWM_PWM_Disable (obj -> base , obj -> counter_id );
244
+ Cy_TCPWM_PWM_DeInit (obj -> base , obj -> counter_id , & pwm_config );
241
245
}
242
246
243
247
void pwmout_write (pwmout_t * obj , float percent )
You can’t perform that action at this time.
0 commit comments