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

Commit

Permalink
Merge pull request #19 from RushOnline/fix-reattach-interrupt
Browse files Browse the repository at this point in the history
bugfix: reattachInterrupt() pass wrong frequency value to setFrequency()
  • Loading branch information
khoih-prog committed Jan 18, 2022
2 parents 3078ac6 + d04c1f0 commit 7f86f9c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ESP8266TimerInterrupt.h
Expand Up @@ -180,7 +180,7 @@ class ESP8266TimerInterrupt
void reattachInterrupt()
{
if ( (_frequency != 0) && (_timerCount != 0) && (_callback != NULL) )
setFrequency(_frequency, _callback);
setFrequency(_frequency / _timerCount, _callback);
}

// Duration (in milliseconds). Duration = 0 or not specified => run indefinitely
Expand Down
2 changes: 1 addition & 1 deletion src_cpp/ESP8266TimerInterrupt.h
Expand Up @@ -180,7 +180,7 @@ class ESP8266TimerInterrupt
void reattachInterrupt()
{
if ( (_frequency != 0) && (_timerCount != 0) && (_callback != NULL) )
setFrequency(_frequency, _callback);
setFrequency(_frequency / _timerCount, _callback);
}

// Duration (in milliseconds). Duration = 0 or not specified => run indefinitely
Expand Down
2 changes: 1 addition & 1 deletion src_h/ESP8266TimerInterrupt.h
Expand Up @@ -180,7 +180,7 @@ class ESP8266TimerInterrupt
void reattachInterrupt()
{
if ( (_frequency != 0) && (_timerCount != 0) && (_callback != NULL) )
setFrequency(_frequency, _callback);
setFrequency(_frequency / _timerCount, _callback);
}

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

0 comments on commit 7f86f9c

Please sign in to comment.