Skip to content

Commit 2299da2

Browse files
author
Brian Baltz
committed
Stop interrupt when switching to 100% duty cycle
Signed-off-by: Brian Baltz <brian.a.baltz@intel.com>
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

Lines changed: 2 additions & 0 deletions
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)
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