mirror of https://github.com/ARMmbed/mbed-os.git
[MAXWSNENV, MAX32600MBED] Fixing pwm array search.
parent
9b9bab51e5
commit
db8697c321
|
@ -77,9 +77,9 @@ void pwmout_init(pwmout_t* obj, PinName pin)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If all instances are in use, overwrite the last
|
// If all instances are in use, overwrite the last
|
||||||
pwm = PinMap_PWM[++i];
|
pwm = PinMap_PWM[i++];
|
||||||
if(pwm.pin != pin) {
|
if(pwm.pin != pin) {
|
||||||
pwm = PinMap_PWM[--i];
|
pwm = PinMap_PWM[(i-1)];
|
||||||
i = -1;
|
i = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,9 +77,9 @@ void pwmout_init(pwmout_t* obj, PinName pin)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If all instances are in use, overwrite the last
|
// If all instances are in use, overwrite the last
|
||||||
pwm = PinMap_PWM[++i];
|
pwm = PinMap_PWM[i++];
|
||||||
if(pwm.pin != pin) {
|
if(pwm.pin != pin) {
|
||||||
pwm = PinMap_PWM[--i];
|
pwm = PinMap_PWM[(i-1)];
|
||||||
i = -1;
|
i = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue