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

Commit 2cd2431

Browse files
authored
Add files via upload
1 parent 6126b06 commit 2cd2431

File tree

7 files changed

+21
-20
lines changed

7 files changed

+21
-20
lines changed

examples/Argument_None/Argument_None.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Built by Khoi Hoang https://github.com/khoih-prog/ESP32TimerInterrupt
77
* Licensed under MIT license
8-
* Version: v1.0.0
8+
* Version: v1.0.1
99
*
1010
* Notes:
1111
* Special design is necessary to share data between interrupt code and the rest of your program.
@@ -24,12 +24,12 @@
2424
#include "ESP8266TimerInterrupt.h"
2525

2626
#ifndef LED_BUILTIN
27-
#define LED_BUILTIN 2 // Pin D2 mapped to pin GPIO2/ADC12 of ESP32, control on-board LED
27+
#define LED_BUILTIN 2 // Pin D4 mapped to pin GPIO2/TXD1 of ESP8266, NodeMCU and WeMoS, control on-board LED
2828
#endif
2929

3030
volatile uint32_t lastMillis = 0;
3131

32-
void IRAM_ATTR TimerHandler(void)
32+
void ICACHE_RAM_ATTR TimerHandler(void)
3333
{
3434
static bool toggle = false;
3535
static bool started = false;

examples/ISR_RPM_Measure/ISR_RPM_Measure.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Built by Khoi Hoang https://github.com/khoih-prog/ESP8266TimerInterrupt
77
* Licensed under MIT license
8-
* Version: v1.0.0
8+
* Version: v1.0.1
99
*
1010
* Notes:
1111
* Special design is necessary to share data between interrupt code and the rest of your program.
@@ -55,12 +55,12 @@ volatile int debounceCounter;
5555

5656
volatile bool activeState = false;
5757

58-
void IRAM_ATTR detectRotation(void)
58+
void ICACHE_RAM_ATTR detectRotation(void)
5959
{
6060
activeState = true;
6161
}
6262

63-
void IRAM_ATTR TimerHandler()
63+
void ICACHE_RAM_ATTR TimerHandler()
6464
{
6565
static bool started = false;
6666

@@ -111,7 +111,7 @@ void setup()
111111
pinMode(interruptPin, INPUT_PULLUP);
112112

113113
// Interval in microsecs
114-
if (ITimer.attachInterruptInterval(TIMER_INTERVAL_MS, TimerHandler))
114+
if (ITimer.attachInterruptInterval(TIMER_INTERVAL_MS * 1000, TimerHandler))
115115
Serial.println("Starting ITimer OK, millis() = " + String(millis()));
116116
else
117117
Serial.println("Can't set ITimer. Select another freq. or interval");

examples/RPM_Measure/RPM_Measure.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Built by Khoi Hoang https://github.com/khoih-prog/ESP8266TimerInterrupt
77
* Licensed under MIT license
8-
* Version: v1.0.0
8+
* Version: v1.0.1
99
*
1010
* Notes:
1111
* Special design is necessary to share data between interrupt code and the rest of your program.
@@ -54,7 +54,7 @@ float avgRPM = 0.00;
5454

5555
volatile int debounceCounter;
5656

57-
void IRAM_ATTR TimerHandler()
57+
void ICACHE_RAM_ATTR TimerHandler()
5858
{
5959
static bool started = false;
6060

examples/SwitchDebounce/SwitchDebounce.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Built by Khoi Hoang https://github.com/khoih-prog/ESP8266TimerInterrupt
77
* Licensed under MIT license
8-
* Version: v1.0.0
8+
* Version: v1.0.1
99
*
1010
* Notes:
1111
* Special design is necessary to share data between interrupt code and the rest of your program.
@@ -47,7 +47,7 @@ ESP8266Timer ITimer;
4747
volatile bool SWPressed = false;
4848
volatile bool SWLongPressed = false;
4949

50-
void IRAM_ATTR TimerHandler()
50+
void ICACHE_RAM_ATTR TimerHandler()
5151
{
5252
static unsigned int debounceCountSWPressed = 0;
5353
static unsigned int debounceCountSWReleased = 0;

examples/TimerInterruptTest/TimerInterruptTest.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Built by Khoi Hoang https://github.com/khoih-prog/ESP8266TimerInterrupt
77
* Licensed under MIT license
8-
* Version: v1.0.0
8+
* Version: v1.0.1
99
*
1010
* Notes:
1111
* Special design is necessary to share data between interrupt code and the rest of your program.
@@ -25,7 +25,7 @@
2525

2626
#include "ESP8266TimerInterrupt.h"
2727

28-
#define BUILTIN_LED 2 //On board LED
28+
#define BUILTIN_LED 2 // Pin D4 mapped to pin GPIO2/TXD1 of ESP8266, NodeMCU and WeMoS, control on-board LED
2929

3030
volatile bool statusLed = false;
3131
volatile uint32_t lastMillis = 0;

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP8266TimerInterrupt
2-
version=1.0.0
2+
version=1.0.1
33
author=Khoi Hoang
44
maintainer=Khoi Hoang
55
license=MIT

src/ESP8266TimerInterrupt.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55
*
66
* Built by Khoi Hoang https://github.com/khoih-prog/ESP32TimerInterrupt
77
* Licensed under MIT license
8-
* Version: 1.0.0
9-
* The ESP32 has two timer groups, each one with two general purpose hardware timers. All the timers
10-
* are based on 64 bits counters and 16 bit prescalers
11-
* The timer counters can be configured to count up or down and support automatic reload and software reload
12-
* They can also generate alarms when they reach a specific value, defined by the software.
13-
* The value of the counter can be read by the software program.
8+
* Version: 1.0.1
9+
*
10+
* The ESP8266 timers are badly designed, using only 23-bit counter along with maximum 256 prescaler. They're only better than UNO / Mega.
11+
* The ESP8266 has two hardware timers, but timer0 has been used for WiFi and it's not advisable to use. Only timer1 is available.
12+
* The timer1's 23-bit counter terribly can count only up to 8,388,607. So the timer1 maximum interval is very short.
13+
* Using 256 prescaler, maximum timer1 interval is only 26.843542 seconds !!!
1414
*
1515
* Version Modified By Date Comments
1616
* ------- ----------- ---------- -----------
1717
* 1.0.0 K Hoang 23/11/2019 Initial coding
18+
* 1.0.1 K Hoang 25/11/2019 New release fixing compiler error
1819
****************************************************************************************/
1920

2021
#ifndef ESP8266TimerInterrupt_h

0 commit comments

Comments
 (0)