File tree 1 file changed +4
-3
lines changed
targets/TARGET_Silicon_Labs/TARGET_EFM32
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ bool pwmout_all_inactive(void) {
131
131
return true;
132
132
}
133
133
#else
134
- if ( PWM_TIMER -> ROUTE & (TIMER_ROUTE_CC0PEN | TIMER_ROUTE_CC1PEN | TIMER_ROUTE_CC2PEN )) {
134
+ if (!( PWM_TIMER -> ROUTE & (TIMER_ROUTE_CC0PEN | TIMER_ROUTE_CC1PEN | TIMER_ROUTE_CC2PEN ) )) {
135
135
return true;
136
136
}
137
137
#endif
@@ -210,10 +210,11 @@ void pwmout_init(pwmout_t *obj, PinName pin)
210
210
#else
211
211
// On P1, the route location is statically defined for the entire timer.
212
212
PWM_TIMER -> ROUTE &= ~_TIMER_ROUTE_LOCATION_MASK ;
213
- if (pwmout_all_inactive ()) {
213
+ // Make sure the route location is not overwritten
214
+ if (pwmout_all_inactive ()) {
214
215
PWM_TIMER -> ROUTE |= pinmap_find_function (pin ,PinMap_PWM ) << _TIMER_ROUTE_LOCATION_SHIFT ;
215
216
} else {
216
- MBED_ASSERT (( pinmap_find_function (pin ,PinMap_PWM ) << _TIMER_ROUTE_LOCATION_SHIFT ) == ( PWM_TIMER -> ROUTE & _TIMER_ROUTE_LOCATION_MASK ) );
217
+ MBED_ASSERT (PWM_TIMER -> ROUTE & _TIMER_ROUTE_LOCATION_MASK == pinmap_find_function (pin ,PinMap_PWM ) << _TIMER_ROUTE_LOCATION_SHIFT );
217
218
}
218
219
#endif
219
220
You can’t perform that action at this time.
0 commit comments