Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit 7f86f9c

Browse files
authored
Merge pull request #19 from RushOnline/fix-reattach-interrupt
bugfix: reattachInterrupt() pass wrong frequency value to setFrequency()
2 parents 3078ac6 + d04c1f0 commit 7f86f9c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/ESP8266TimerInterrupt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class ESP8266TimerInterrupt
180180
void reattachInterrupt()
181181
{
182182
if ( (_frequency != 0) && (_timerCount != 0) && (_callback != NULL) )
183-
setFrequency(_frequency, _callback);
183+
setFrequency(_frequency / _timerCount, _callback);
184184
}
185185

186186
// Duration (in milliseconds). Duration = 0 or not specified => run indefinitely

src_cpp/ESP8266TimerInterrupt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class ESP8266TimerInterrupt
180180
void reattachInterrupt()
181181
{
182182
if ( (_frequency != 0) && (_timerCount != 0) && (_callback != NULL) )
183-
setFrequency(_frequency, _callback);
183+
setFrequency(_frequency / _timerCount, _callback);
184184
}
185185

186186
// Duration (in milliseconds). Duration = 0 or not specified => run indefinitely

src_h/ESP8266TimerInterrupt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class ESP8266TimerInterrupt
180180
void reattachInterrupt()
181181
{
182182
if ( (_frequency != 0) && (_timerCount != 0) && (_callback != NULL) )
183-
setFrequency(_frequency, _callback);
183+
setFrequency(_frequency / _timerCount, _callback);
184184
}
185185

186186
// Duration (in milliseconds). Duration = 0 or not specified => run indefinitely

0 commit comments

Comments
 (0)