File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
targets/TARGET_Silicon_Labs/TARGET_EFM32 Expand file tree Collapse file tree 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) {
131131 return true;
132132 }
133133#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 ) )) {
135135 return true;
136136 }
137137#endif
@@ -210,10 +210,11 @@ void pwmout_init(pwmout_t *obj, PinName pin)
210210#else
211211 // On P1, the route location is statically defined for the entire timer.
212212 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 ()) {
214215 PWM_TIMER -> ROUTE |= pinmap_find_function (pin ,PinMap_PWM ) << _TIMER_ROUTE_LOCATION_SHIFT ;
215216 } 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 );
217218 }
218219#endif
219220
You can’t perform that action at this time.
0 commit comments