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

Commit c1f53d3

Browse files
authored
v1.3.0 to match new ESP8266 core v3.0.0
### Releases v1.3.0 1. Update ### Releases v1.3.0 1. Update to match new ESP8266 core v3.0.0
1 parent 4737653 commit c1f53d3

27 files changed

+286
-253
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1515
Please ensure to specify the following:
1616

1717
* Arduino IDE version (e.g. 1.8.13) or Platform.io version
18-
* `ESP8266` Core Version (e.g. ESP8266 core v2.7.4)
18+
* `ESP8266` Core Version (e.g. ESP8266 core v3.0.0)
1919
* Contextual information (e.g. what you were trying to achieve)
2020
* Simplest possible steps to reproduce
2121
* Anything that might be relevant in your opinion, such as:
@@ -26,11 +26,11 @@ Please ensure to specify the following:
2626
### Example
2727

2828
```
29-
Arduino IDE version: 1.8.13
30-
ESP8266 Core Version 2.7.4
29+
Arduino IDE version: v1.8.13
30+
ESP8266 Core Version v3.0.0
3131
ESP8266_NODEMCU
3232
OS: Ubuntu 20.04 LTS
33-
Linux xy-Inspiron-3593 5.4.0-51-generic #56-Ubuntu SMP Mon Oct 5 14:28:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
33+
Linux xy-Inspiron-3593 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3434
3535
Context:
3636
I encountered a crash while trying to use the Timer Interrupt.

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
123123

124124
## Changelog
125125

126+
### Releases v1.3.0
127+
128+
1. Update to match new ESP8266 core v3.0.0
129+
126130
### Releases v1.2.0
127131

128132
1. Add better debug feature.
@@ -158,7 +162,8 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
158162
## Prerequisites
159163

160164
1. [`Arduino IDE 1.8.13+`](https://www.arduino.cc/en/Main/Software)
161-
2. [`ESP8266 Core 2.7.4+`](https://github.com/esp8266/Arduino) for ESP8266-based boards. [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/). To use ESP8266 core 2.7.1+ for LittleFS.
165+
2. [`ESP8266 Core 3.0.0+`](https://github.com/esp8266/Arduino) for ESP8266-based boards. [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/). To use ESP8266 core 2.7.1+ for LittleFS.
166+
3. [`Blynk_WM library v1.5.0+`](https://github.com/khoih-prog/Blynk_WM) to use with some examples. To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/Blynk_WiFiManager.svg?)](https://www.ardu-badge.com/Blynk_WiFiManager)
162167

163168
---
164169
---
@@ -342,7 +347,7 @@ ESP8266_ISR_Timer ISR_Timer;
342347

343348
BlynkTimer blynkTimer;
344349

345-
void ICACHE_RAM_ATTR TimerHandler()
350+
void IRAM_ATTR TimerHandler()
346351
{
347352
static bool toggle = false;
348353
static bool started = false;
@@ -373,7 +378,7 @@ void ICACHE_RAM_ATTR TimerHandler()
373378
}
374379
}
375380

376-
void ICACHE_RAM_ATTR doingSomething2s()
381+
void IRAM_ATTR doingSomething2s()
377382
{
378383
#if (TIMER_INTERRUPT_DEBUG > 0)
379384
static unsigned long previousMillis = lastMillis;
@@ -384,7 +389,7 @@ void ICACHE_RAM_ATTR doingSomething2s()
384389
#endif
385390
}
386391

387-
void ICACHE_RAM_ATTR doingSomething5s()
392+
void IRAM_ATTR doingSomething5s()
388393
{
389394
#if (TIMER_INTERRUPT_DEBUG > 0)
390395
static unsigned long previousMillis = lastMillis;
@@ -395,7 +400,7 @@ void ICACHE_RAM_ATTR doingSomething5s()
395400
#endif
396401
}
397402

398-
void ICACHE_RAM_ATTR doingSomething10s()
403+
void IRAM_ATTR doingSomething10s()
399404
{
400405
#if (TIMER_INTERRUPT_DEBUG > 0)
401406
static unsigned long previousMillis = lastMillis;
@@ -406,7 +411,7 @@ void ICACHE_RAM_ATTR doingSomething10s()
406411
#endif
407412
}
408413

409-
void ICACHE_RAM_ATTR doingSomething50s()
414+
void IRAM_ATTR doingSomething50s()
410415
{
411416
#if (TIMER_INTERRUPT_DEBUG > 0)
412417
static unsigned long previousMillis = lastMillis;
@@ -510,7 +515,7 @@ While software timer, **programmed for 2s, is activated after 4.258s !!!**
510515

511516
```
512517
Starting ISR_Timer_Complex on ESP8266_NODEMCU
513-
ESP8266TimerInterrupt v1.2.0
518+
ESP8266TimerInterrupt v1.3.0
514519
CPU Frequency = 160 MHz
515520
ESP8266TimerInterrupt: _fre = 312500.00, _count = 15625
516521
Starting ITimer OK, millis() = 64
@@ -558,7 +563,7 @@ The following is the sample terminal output when running example [TimerInterrupt
558563

559564
```
560565
Starting TimerInterruptTest on ESP8266_NODEMCU
561-
ESP8266TimerInterrupt v1.2.0
566+
ESP8266TimerInterrupt v1.3.0
562567
CPU Frequency = 160 MHz
563568
ESP8266TimerInterrupt: _fre = 312500.00, _count = 312500
564569
Starting ITimer OK, millis() = 262
@@ -590,7 +595,7 @@ The following is the sample terminal output when running example [Change_Interva
590595

591596
```
592597
Starting Change_Interval on ESP8266_NODEMCU
593-
ESP8266TimerInterrupt v1.2.0
598+
ESP8266TimerInterrupt v1.3.0
594599
CPU Frequency = 160 MHz
595600
Starting ITimer OK, millis() = 162
596601
Time = 10001, TimerCount = 19
@@ -651,6 +656,10 @@ Sometimes, the library will only work if you update the board core to the latest
651656

652657
## Releases
653658

659+
### Releases v1.3.0
660+
661+
1. Update to match new ESP8266 core v3.0.0
662+
654663
### Releases v1.2.0
655664

656665
1. Add better debug feature.
@@ -711,6 +720,7 @@ Submit issues to: [ESP8266TimerInterrupt issues](https://github.com/khoih-prog/E
711720
2. More hardware-initiated software-enabled timers
712721
3. Longer time interval
713722
4. Similar features for remaining Arduino boards such as AVR, Teensy, SAMD21, SAMD51, SAM-DUE, nRF52, ESP32, STM32, etc.
723+
5. Update to match new ESP8266 core v3.0.0
714724

715725
---
716726
---

examples/Argument_None/Argument_None.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
Based on BlynkTimer.h
2424
Author: Volodymyr Shymanskyy
2525
26-
Version: 1.2.0
26+
Version: 1.3.0
2727
2828
Version Modified By Date Comments
2929
------- ----------- ---------- -----------
@@ -34,6 +34,7 @@
3434
1.1.0 K.Hoang 27/10/2020 Restore cpp code besides Impl.h code to use if Multiple-Definition linker error.
3535
1.1.1 K.Hoang 06/12/2020 Add Version String and Change_Interval example to show how to change TimerInterval
3636
1.2.0 K.Hoang 08/01/2021 Add better debug feature. Optimize code and examples to reduce RAM usage
37+
1.3.0 K.Hoang 18/05/2021 Update to match new ESP8266 core v3.0.0
3738
*****************************************************************************************************************************/
3839

3940
/* Notes:
@@ -65,7 +66,7 @@
6566

6667
volatile uint32_t lastMillis = 0;
6768

68-
void ICACHE_RAM_ATTR TimerHandler()
69+
void IRAM_ATTR TimerHandler()
6970
{
7071
static bool toggle = false;
7172
static bool started = false;

examples/Change_Interval/Change_Interval.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
Based on BlynkTimer.h
2424
Author: Volodymyr Shymanskyy
2525
26-
Version: 1.2.0
26+
Version: 1.3.0
2727
2828
Version Modified By Date Comments
2929
------- ----------- ---------- -----------
@@ -34,6 +34,7 @@
3434
1.1.0 K.Hoang 27/10/2020 Restore cpp code besides Impl.h code to use if Multiple-Definition linker error.
3535
1.1.1 K.Hoang 06/12/2020 Add Version String and Change_Interval example to show how to change TimerInterval
3636
1.2.0 K.Hoang 08/01/2021 Add better debug feature. Optimize code and examples to reduce RAM usage
37+
1.3.0 K.Hoang 18/05/2021 Update to match new ESP8266 core v3.0.0
3738
*****************************************************************************************************************************/
3839

3940
/*

examples/ISR_RPM_Measure/ISR_RPM_Measure.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
Based on BlynkTimer.h
2424
Author: Volodymyr Shymanskyy
2525
26-
Version: 1.2.0
26+
Version: 1.3.0
2727
2828
Version Modified By Date Comments
2929
------- ----------- ---------- -----------
@@ -34,6 +34,7 @@
3434
1.1.0 K.Hoang 27/10/2020 Restore cpp code besides Impl.h code to use if Multiple-Definition linker error.
3535
1.1.1 K.Hoang 06/12/2020 Add Version String and Change_Interval example to show how to change TimerInterval
3636
1.2.0 K.Hoang 08/01/2021 Add better debug feature. Optimize code and examples to reduce RAM usage
37+
1.3.0 K.Hoang 18/05/2021 Update to match new ESP8266 core v3.0.0
3738
*****************************************************************************************************************************/
3839

3940
/* Notes:
@@ -89,12 +90,12 @@ volatile int debounceCounter;
8990

9091
volatile bool activeState = false;
9192

92-
void ICACHE_RAM_ATTR detectRotation()
93+
void IRAM_ATTR detectRotation()
9394
{
9495
activeState = true;
9596
}
9697

97-
void ICACHE_RAM_ATTR TimerHandler()
98+
void IRAM_ATTR TimerHandler()
9899
{
99100
if ( activeState )
100101
{

examples/ISR_Switch/ISR_Switch.ino

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
Based on BlynkTimer.h
2424
Author: Volodymyr Shymanskyy
2525
26-
Version: 1.2.0
26+
Version: 1.3.0
2727
2828
Version Modified By Date Comments
2929
------- ----------- ---------- -----------
@@ -34,6 +34,7 @@
3434
1.1.0 K.Hoang 27/10/2020 Restore cpp code besides Impl.h code to use if Multiple-Definition linker error.
3535
1.1.1 K.Hoang 06/12/2020 Add Version String and Change_Interval example to show how to change TimerInterval
3636
1.2.0 K.Hoang 08/01/2021 Add better debug feature. Optimize code and examples to reduce RAM usage
37+
1.3.0 K.Hoang 18/05/2021 Update to match new ESP8266 core v3.0.0
3738
*****************************************************************************************************************************/
3839
/* Notes:
3940
Special design is necessary to share data between interrupt code and the rest of your program.
@@ -125,13 +126,13 @@ BlynkTimer Timer;
125126
unsigned int myWiFiTimeout = 3200L; // 3.2s WiFi connection timeout (WCT)
126127
unsigned int buttonInterval = 511L; // 0.5s update button state
127128

128-
void ICACHE_RAM_ATTR Falling();
129-
void ICACHE_RAM_ATTR Rising();
129+
void IRAM_ATTR Falling();
130+
void IRAM_ATTR Rising();
130131

131-
void ICACHE_RAM_ATTR lightOn();
132-
void ICACHE_RAM_ATTR lightOff();
133-
void ICACHE_RAM_ATTR ButtonCheck();
134-
void ICACHE_RAM_ATTR ToggleRelay();
132+
void IRAM_ATTR lightOn();
133+
void IRAM_ATTR lightOff();
134+
void IRAM_ATTR ButtonCheck();
135+
void IRAM_ATTR ToggleRelay();
135136

136137
BLYNK_CONNECTED()
137138
{
@@ -147,7 +148,7 @@ BLYNK_WRITE(VPIN)
147148
ToggleRelay();
148149
}
149150

150-
void ICACHE_RAM_ATTR Rising()
151+
void IRAM_ATTR Rising()
151152
{
152153
unsigned long currentTime = millis();
153154
unsigned long TimeDiff;
@@ -163,7 +164,7 @@ void ICACHE_RAM_ATTR Rising()
163164
}
164165
}
165166

166-
void ICACHE_RAM_ATTR Falling()
167+
void IRAM_ATTR Falling()
167168
{
168169
unsigned long currentTime = millis();
169170

@@ -210,7 +211,7 @@ void checkButton()
210211
Blynk.setProperty(LAMPSTATE_PIN, "color", BLYNK_GREEN);
211212
}
212213

213-
void ICACHE_RAM_ATTR ButtonCheck()
214+
void IRAM_ATTR ButtonCheck()
214215
{
215216
boolean SwitchState = (digitalRead(BUTTON_PIN));
216217

@@ -225,21 +226,21 @@ void ICACHE_RAM_ATTR ButtonCheck()
225226
}
226227
}
227228

228-
void ICACHE_RAM_ATTR ToggleRelay()
229+
void IRAM_ATTR ToggleRelay()
229230
{
230231
if (LampState)
231232
lightOff();
232233
else
233234
lightOn();
234235
}
235236

236-
void ICACHE_RAM_ATTR lightOn()
237+
void IRAM_ATTR lightOn()
237238
{
238239
digitalWrite(RELAY_PIN, HIGH);
239240
LampState = true;
240241
}
241242

242-
void ICACHE_RAM_ATTR lightOff()
243+
void IRAM_ATTR lightOff()
243244
{
244245
digitalWrite(RELAY_PIN, LOW);
245246
LampState = false;

0 commit comments

Comments
 (0)