From d04c1f0fc3523dfe582768548ab1f73380b9f16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=9D=D0=B5?= =?UTF-8?q?=D0=BF=D0=BE=D0=BC=D0=BD=D1=8F=D1=89=D0=B8=D0=B9?= Date: Tue, 18 Jan 2022 23:43:00 +0300 Subject: [PATCH] bugfix: reattachInterrupt() pass wrong frequency value to setFrequency() --- src/ESP8266TimerInterrupt.h | 2 +- src_cpp/ESP8266TimerInterrupt.h | 2 +- src_h/ESP8266TimerInterrupt.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ESP8266TimerInterrupt.h b/src/ESP8266TimerInterrupt.h index 0fe4e3d..06f941f 100644 --- a/src/ESP8266TimerInterrupt.h +++ b/src/ESP8266TimerInterrupt.h @@ -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 diff --git a/src_cpp/ESP8266TimerInterrupt.h b/src_cpp/ESP8266TimerInterrupt.h index 0fe4e3d..06f941f 100644 --- a/src_cpp/ESP8266TimerInterrupt.h +++ b/src_cpp/ESP8266TimerInterrupt.h @@ -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 diff --git a/src_h/ESP8266TimerInterrupt.h b/src_h/ESP8266TimerInterrupt.h index 0fe4e3d..06f941f 100644 --- a/src_h/ESP8266TimerInterrupt.h +++ b/src_h/ESP8266TimerInterrupt.h @@ -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