Skip to content

Commit 1817fd2

Browse files
committed
cores/psoc6: Code Fix.
Signed-off-by: IFX-Anusha <Anusha.TR@infineon.com>
1 parent 6819235 commit 1817fd2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cores/psoc6/analog_io.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,13 @@ void setAnalogWriteFrequency(pin_size_t pinNumber, uint32_t frequency) {
203203
}
204204

205205
for (uint8_t i = 0; i < PWM_HOWMANY; i++) {
206+
pwm[i].frequency_hz = frequency;
206207
if (pwm[i].initialized && pwm[i].pin == pinNumber) {
207208
cy_rslt_t result = cyhal_pwm_set_duty_cycle(&pwm[i].pwm_obj, pwm[i].duty_cycle_percent, frequency);
208209
if (result != CY_RSLT_SUCCESS) {
209210
pwm_assert(result);
210211
}
211212
return;
212-
} else {
213-
pwm[i].frequency_hz = frequency; // Store the frequency for use in analogwrite
214213
}
215214
}
216215
}

0 commit comments

Comments
 (0)