Skip to content

Commit

Permalink
fix(hardwaretimer): resume if not running
Browse files Browse the repository at this point in the history
not only if previous mode is different.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
  • Loading branch information
fpistm committed Nov 21, 2024
1 parent 32b6654 commit d99f7c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/SrcWrapper/src/HardwareTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ void HardwareTimer::setPWM(uint32_t channel, PinName pin, uint32_t frequency, ui
if (CompareCallback) {
attachInterrupt(channel, CompareCallback);
}
if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) {
if (!isRunning() || (previousMode != TIMER_OUTPUT_COMPARE_PWM1)) {
resume();
}
}
Expand Down

0 comments on commit d99f7c9

Please sign in to comment.