Skip to content

Commit db8697c

Browse files
[MAXWSNENV, MAX32600MBED] Fixing pwm array search.
1 parent 9b9bab5 commit db8697c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libraries/mbed/targets/hal/TARGET_Maxim/TARGET_MAX32600/pwmout_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ void pwmout_init(pwmout_t* obj, PinName pin)
7777
}
7878

7979
// If all instances are in use, overwrite the last
80-
pwm = PinMap_PWM[++i];
80+
pwm = PinMap_PWM[i++];
8181
if(pwm.pin != pin) {
82-
pwm = PinMap_PWM[--i];
82+
pwm = PinMap_PWM[(i-1)];
8383
i = -1;
8484
break;
8585
}

libraries/mbed/targets/hal/TARGET_Maxim/TARGET_MAX32610/pwmout_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ void pwmout_init(pwmout_t* obj, PinName pin)
7777
}
7878

7979
// If all instances are in use, overwrite the last
80-
pwm = PinMap_PWM[++i];
80+
pwm = PinMap_PWM[i++];
8181
if(pwm.pin != pin) {
82-
pwm = PinMap_PWM[--i];
82+
pwm = PinMap_PWM[(i-1)];
8383
i = -1;
8484
break;
8585
}

0 commit comments

Comments
 (0)