Skip to content

Commit 2299da2

Browse files
author
Brian Baltz
committed
Stop interrupt when switching to 100% duty cycle
Signed-off-by: Brian Baltz <[email protected]>
1 parent da68b6f commit 2299da2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libraries/CurieTimerOne/CurieTimer.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ int CurieTimer::pwmStart(unsigned int outputPin, double dutyPercentage, unsigned
170170
}
171171

172172
if(dutyPercentage == 100.0) {
173+
// If PWM is already running, reset the timer and set pin to HIGH
174+
kill();
173175
digitalWrite(pwmPin, HIGH);
174176
return SUCCESS;
175177
}

0 commit comments

Comments
 (0)