Skip to content

Commit a17fc44

Browse files
committed
fix(hardwaretimer): resume if not running
not only if previous mode is different. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 32b6654 commit a17fc44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/SrcWrapper/src/HardwareTimer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ void HardwareTimer::setPWM(uint32_t channel, PinName pin, uint32_t frequency, ui
937937
if (CompareCallback) {
938938
attachInterrupt(channel, CompareCallback);
939939
}
940-
if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) {
940+
if (!isRunning() || !isRunningChannel(channel) || (previousMode != TIMER_OUTPUT_COMPARE_PWM1)) {
941941
resume();
942942
}
943943
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy