Skip to content

Commit da68b6f

Browse files
author
Brian Baltz
committed
ATLEDGE-516 Stop callback when setting duty cycle to 0
Signed-off-by: Brian Baltz <brian.a.baltz@intel.com>
1 parent ef62ce6 commit da68b6f

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
@@ -163,6 +163,8 @@ int CurieTimer::pwmStart(unsigned int outputPin, double dutyPercentage, unsigned
163163
pinMode(pwmPin, OUTPUT);
164164

165165
if(dutyPercentage == 0.0) {
166+
// If PWM is already running, reset the timer and set pin to LOW
167+
kill();
166168
digitalWrite(pwmPin, LOW);
167169
return SUCCESS;
168170
}

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