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

Commit 4c7dcd9

Browse files
authored
v2.2.0 to add support to more boards
### Releases v2.2.0 1. Suppress warnings for ESP32_C3, ESP32_S2 and ESP32_S3 2. Add support to - ESP32_S2 : ESP32S2 Native USB, UM FeatherS2 Neo, UM TinyS2, UM RMP, microS2, LOLIN_S2_MINI, LOLIN_S2_PICO, ADAFRUIT_FEATHER_ESP32S2, ADAFRUIT_FEATHER_ESP32S2_TFT, ATMegaZero ESP32-S2, Deneyap Mini, FRANZININHO_WIFI, FRANZININHO_WIFI_MSC - ESP32_S3 : UM TinyS3, UM PROS3, UM FeatherS3, ESP32_S3_USB_OTG, ESP32S3_CAM_LCD, DFROBOT_FIREBEETLE_2_ESP32S3, ADAFRUIT_FEATHER_ESP32S3_TFT - ESP32_C3 : LOLIN_C3_MINI, DFROBOT_BEETLE_ESP32_C3, ADAFRUIT_QTPY_ESP32C3, AirM2M_CORE_ESP32C3, XIAO_ESP32C3
1 parent 390ab4c commit 4c7dcd9

13 files changed

+88
-36
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Please ensure to specify the following:
1919
* `ESP32` Board type (e.g. ESP32_DEV Module, etc.)
2020
* `ESP32-S2` Board type (e.g. ESP32S2_DEV Module, ESP32_S2_Saola, etc.)
2121
* `ESP32_S3` Board type (e.g. ESP32S3_DEV, ESP32_S3_BOX, UM TINYS3, UM PROS3, UM FEATHERS3, etc.)
22-
* `ESP32-C3` Board type (e.g. ESP32C3_DEV Module, etc.)
22+
* `ESP32-C3` Board type (e.g. ESP32C3_DEV Module, LOLIN_C3_MINI, DFROBOT_BEETLE_ESP32_C3, ADAFRUIT_QTPY_ESP32C3, AirM2M_CORE_ESP32C3, XIAO_ESP32C3, etc.)
2323
* Contextual information (e.g. what you were trying to achieve)
2424
* Simplest possible steps to reproduce
2525
* Anything that might be relevant in your opinion, such as:

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
119119
### Currently supported Boards
120120

121121
1. ESP32 boards, such as `ESP32_DEV`, etc.
122-
2. ESP32S2-based boards, such as `ESP32S2_DEV`, `ESP32_S2 Saola`, Adafruit QTPY_ESP32S2, etc.
123-
3. ESP32C3-based boards, such as `ESP32C3_DEV`, etc. **New**
124-
4. ESP32_S3 (ESP32S3_DEV, ESP32_S3_BOX, UM TINYS3, UM PROS3, UM FEATHERS3, FEATHER_ESP32S3_NOPSRAM and QTPY_ESP32S3_NOPSRAM, etc.) **New**
122+
2. ESP32_S2-based boards, such as `ESP32S2_DEV`, `ESP32_S2 Saola`, Adafruit QTPY_ESP32S2, ESP32S2 Native USB, UM FeatherS2 Neo, UM TinyS2, UM RMP, microS2, etc.
123+
3. ESP32_C3-based boards, such as `ESP32C3_DEV`, LOLIN_C3_MINI, DFROBOT_BEETLE_ESP32_C3, ADAFRUIT_QTPY_ESP32C3, AirM2M_CORE_ESP32C3, XIAO_ESP32C3, etc. **New**
124+
4. ESP32_S3-based boards, such as ESP32S3_DEV, ESP32_S3_BOX, UM TINYS3, UM PROS3, UM FEATHERS3, FEATHER_ESP32S3_NOPSRAM, QTPY_ESP32S3_NOPSRAM, etc. **New**
125125

126126
---
127127

@@ -333,7 +333,7 @@ The following is the sample terminal output when running example [TimerInterrupt
333333

334334
```
335335
Starting TimerInterruptTest on ESP32C3_DEV
336-
ESP32TimerInterrupt v2.1.0
336+
ESP32TimerInterrupt v2.2.0
337337
CPU Frequency = 160 MHz
338338
[TISR] ESP32_TimerInterrupt: _timerNo = 0 , _fre = 1000000
339339
[TISR] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -368,7 +368,7 @@ The following is the sample terminal output when running example [Change_Interva
368368

369369
```
370370
Starting Change_Interval on ESP32C3_DEV
371-
ESP32TimerInterrupt v2.1.0
371+
ESP32TimerInterrupt v2.2.0
372372
CPU Frequency = 160 MHz
373373
Starting ITimer0 OK, millis() = 293
374374
Starting ITimer1 OK, millis() = 303
@@ -403,7 +403,7 @@ The following is the sample terminal output when running example [Argument_None]
403403

404404
```
405405
Starting Argument_None on ESP32S3_DEV
406-
ESP32TimerInterrupt v2.1.0
406+
ESP32TimerInterrupt v2.2.0
407407
CPU Frequency = 240 MHz
408408
[TISR] ESP32_S3_TimerInterrupt: _timerNo = 0 , _fre = 1000000
409409
[TISR] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -427,7 +427,7 @@ The following is the sample terminal output when running example [ISR_16_Timers_
427427

428428
```
429429
Starting ISR_16_Timers_Array_Complex on ESP32S3_DEV
430-
ESP32TimerInterrupt v2.1.0
430+
ESP32TimerInterrupt v2.2.0
431431
CPU Frequency = 240 MHz
432432
[TISR] ESP32_S3_TimerInterrupt: _timerNo = 1 , _fre = 1000000
433433
[TISR] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -601,7 +601,7 @@ The following is the sample terminal output when running example [ISR_16_Timers_
601601

602602
```
603603
Starting ISR_16_Timers_Array on ESP32S3_DEV
604-
ESP32TimerInterrupt v2.1.0
604+
ESP32TimerInterrupt v2.2.0
605605
CPU Frequency = 240 MHz
606606
[TISR] ESP32_S3_TimerInterrupt: _timerNo = 1 , _fre = 1000000
607607
[TISR] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -624,7 +624,7 @@ The following is the sample terminal output when running example [ISR_16_Timers_
624624

625625
```
626626
Starting ISR_16_Timers_Array_Complex on ESP32C3_DEV
627-
ESP32TimerInterrupt v2.1.0
627+
ESP32TimerInterrupt v2.2.0
628628
CPU Frequency = 160 MHz
629629
[TISR] ESP32_TimerInterrupt: _timerNo = 1 , _fre = 1000000
630630
[TISR] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -847,7 +847,10 @@ Submit issues to: [ESP32TimerInterrupt issues](https://github.com/khoih-prog/ESP
847847
14. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project
848848
15. Add example [ISR_16_Timers_Array_Complex_OneShot](examples/ISR_16_Timers_Array_Complex_OneShot) to demo how to use `one-shot ISR-based timer` in complex case
849849
16. Add example [ISR_16_Timers_Array_OneShot](examples/ISR_16_Timers_Array_OneShot) to demo how to use `one-shot ISR-based timer`
850-
850+
17. Add support to many more boards, such as
851+
- ESP32_S2 : ESP32S2 Native USB, UM FeatherS2 Neo, UM TinyS2, UM RMP, microS2, LOLIN_S2_MINI, LOLIN_S2_PICO, ADAFRUIT_FEATHER_ESP32S2, ADAFRUIT_FEATHER_ESP32S2_TFT, ATMegaZero ESP32-S2, Deneyap Mini, FRANZININHO_WIFI, FRANZININHO_WIFI_MSC
852+
- ESP32_S3 : UM TinyS3, UM PROS3, UM FeatherS3, ESP32_S3_USB_OTG, ESP32S3_CAM_LCD, DFROBOT_FIREBEETLE_2_ESP32S3, ADAFRUIT_FEATHER_ESP32S3_TFT
853+
- ESP32_C3 : LOLIN_C3_MINI, DFROBOT_BEETLE_ESP32_C3, ADAFRUIT_QTPY_ESP32C3, AirM2M_CORE_ESP32C3, XIAO_ESP32C3
851854

852855
---
853856
---

changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Releases v2.2.0](#releases-v220)
1516
* [Releases v2.1.0](#releases-v210)
1617
* [Releases v2.0.2](#releases-v202)
1718
* [Releases v2.0.1](#releases-v201)
@@ -31,6 +32,14 @@
3132

3233
## Changelog
3334

35+
### Releases v2.2.0
36+
37+
1. Suppress warnings for ESP32_C3, ESP32_S2 and ESP32_S3
38+
2. Add support to
39+
- ESP32_S2 : ESP32S2 Native USB, UM FeatherS2 Neo, UM TinyS2, UM RMP, microS2, LOLIN_S2_MINI, LOLIN_S2_PICO, ADAFRUIT_FEATHER_ESP32S2, ADAFRUIT_FEATHER_ESP32S2_TFT, ATMegaZero ESP32-S2, Deneyap Mini, FRANZININHO_WIFI, FRANZININHO_WIFI_MSC
40+
- ESP32_S3 : UM TinyS3, UM PROS3, UM FeatherS3, ESP32_S3_USB_OTG, ESP32S3_CAM_LCD, DFROBOT_FIREBEETLE_2_ESP32S3, ADAFRUIT_FEATHER_ESP32S3_TFT
41+
- ESP32_C3 : LOLIN_C3_MINI, DFROBOT_BEETLE_ESP32_C3, ADAFRUIT_QTPY_ESP32C3, AirM2M_CORE_ESP32C3, XIAO_ESP32C3
42+
3443
### Releases v2.1.0
3544

3645
1. Suppress errors and warnings for new ESP32 core v2.0.4+

examples/multiFileProject/multiFileProject.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
#define TIMER_INTERRUPT_DEBUG 2
1919
#define _TIMERINTERRUPT_LOGLEVEL_ 0
2020

21-
#ifndef LED_BUILTIN
22-
#define LED_BUILTIN 2
23-
#endif
24-
2521
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
2622
#include "ESP32TimerInterrupt.hpp"
2723
#include "ESP32_ISR_Timer.hpp"
2824

25+
#ifndef LED_BUILTIN
26+
#define LED_BUILTIN 2
27+
#endif
28+
2929
extern ESP32_ISR_Timer ISR_Timer; // declaration of the global variable ISRTimer
3030

3131
void setupISR();

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ESP32TimerInterrupt",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"keywords": "timing, device, control, timer, interrupt, timer-interrupt, hardware, isr, isr-based, hardware-timer, isr-timer, isr-based-timer, mission-critical, accuracy, precise, non-blocking, esp32, esp32-s2, esp32-c3, esp32-s3",
55
"description": "This library enables you to use Interrupt from Hardware Timers on ESP32-based (including ESP32_S2, ESP32_S3 and ESP32_C3) boards. It now supports 16 ISR-based timers, while consuming only 1 Hardware Timer. Timers interval is very long (ulong millisecs). The most important feature is they're ISR-based timers. Therefore, their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks. These hardware timers, using interrupt, still work even if other functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software timers using millis() or micros(). That's necessary if you need to measure some data requiring better accuracy.",
66
"authors":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP32TimerInterrupt
2-
version=2.1.0
2+
version=2.2.0
33
author=Khoi Hoang <khoih.prog@gmail.com>
44
maintainer=Khoi Hoang <khoih.prog@gmail.com>
55
sentence=This library enables you to use Interrupt from Hardware Timers on ESP32-based (including ESP32_S2, ESP32_S3 and ESP32_C3) boards

platformio/platformio.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ build_flags =
4242
; comment the folowing line to enable WiFi debugging
4343
-D NDEBUG
4444

45+
46+
; ============================================================
47+
; ============================================================
48+
4549
[env:ESP32]
4650
platform = espressif32
4751
framework = arduino
@@ -84,6 +88,8 @@ board = esp32doit-devkit-v1
8488
;board = iotbusproteus
8589
;board = nina_w10
8690

91+
; ============================================================
92+
8793
[env:esp32s2]
8894
platform = espressif32
8995
framework = arduino
@@ -112,6 +118,7 @@ build_flags =
112118
-DARDUINO_ESP32S2_DEV
113119
-DARDUINO_VARIANT="esp32s2"
114120

121+
; ============================================================
115122

116123
[env:esp32s3]
117124
platform = espressif32
@@ -131,6 +138,7 @@ build_flags =
131138
-DARDUINO_ESP32S3_DEV
132139
-DARDUINO_VARIANT="esp32s3"
133140

141+
; ============================================================
134142

135143
[env:esp32sc3]
136144
platform = espressif32
@@ -150,3 +158,4 @@ build_flags =
150158
-DARDUINO_ESP32S3_DEV
151159
-DARDUINO_VARIANT="esp32c3"
152160

161+
; ============================================================

src/ESP32TimerInterrupt.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
Based on BlynkTimer.h
3030
Author: Volodymyr Shymanskyy
3131
32-
Version: 2.1.0
32+
Version: 2.2.0
3333
3434
Version Modified By Date Comments
3535
------- ----------- ---------- -----------
@@ -48,6 +48,7 @@
4848
2.0.1 K Hoang 13/03/2022 Add example to demo how to use one-shot ISR-based timers. Optimize code
4949
2.0.2 K Hoang 16/06/2022 Add support to new Adafruit boards
5050
2.1.0 K Hoang 03/08/2022 Suppress errors and warnings for new ESP32 core
51+
2.2.0 K Hoang 11/08/2022 Add support and suppress warnings for ESP32_C3, ESP32_S2 and ESP32_S3 boards
5152
*****************************************************************************************************************************/
5253

5354
#pragma once

src/ESP32TimerInterrupt.hpp

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
Based on BlynkTimer.h
3030
Author: Volodymyr Shymanskyy
3131
32-
Version: 2.1.0
32+
Version: 2.2.0
3333
3434
Version Modified By Date Comments
3535
------- ----------- ---------- -----------
@@ -48,6 +48,7 @@
4848
2.0.1 K Hoang 13/03/2022 Add example to demo how to use one-shot ISR-based timers. Optimize code
4949
2.0.2 K Hoang 16/06/2022 Add support to new Adafruit boards
5050
2.1.0 K Hoang 03/08/2022 Suppress errors and warnings for new ESP32 core
51+
2.2.0 K Hoang 11/08/2022 Add support and suppress warnings for ESP32_C3, ESP32_S2 and ESP32_S3 boards
5152
*****************************************************************************************************************************/
5253

5354
#pragma once
@@ -57,28 +58,50 @@
5758

5859
#if ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \
5960
ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \
60-
ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM || ARDUINO_ADAFRUIT_QTPY_ESP32S2)
61+
ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM || ARDUINO_ADAFRUIT_QTPY_ESP32S2 || ARDUINO_ESP32S2_USB || \
62+
ARDUINO_FEATHERS2NEO || ARDUINO_TINYS2 || ARDUINO_RMP || ARDUINO_LOLIN_S2_MINI || ARDUINO_LOLIN_S2_PICO || \
63+
ARDUINO_ADAFRUIT_FEATHER_ESP32S2 || ARDUINO_ADAFRUIT_FEATHER_ESP32S2_TFT || ARDUINO_atmegazero_esp32s2 || \
64+
ARDUINO_DYM || ARDUINO_FRANZININHO_WIFI || ARDUINO_FRANZININHO_WIFI_MSC )
6165
#define USING_ESP32_S2_TIMERINTERRUPT true
66+
67+
#if (_TIMERINTERRUPT_LOGLEVEL_ > 3)
68+
#warning USING_ESP32_S2_TIMERINTERRUPT
69+
#endif
6270
#elif ( defined(ARDUINO_ESP32S3_DEV) || defined(ARDUINO_ESP32_S3_BOX) || defined(ARDUINO_TINYS3) || \
6371
defined(ARDUINO_PROS3) || defined(ARDUINO_FEATHERS3) || defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_NOPSRAM) || \
64-
defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_NOPSRAM))
72+
defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_NOPSRAM) || defined(ARDUINO_ESP32S3_CAM_LCD) || \
73+
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3) || defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_TFT) || \
74+
defined(ARDUINO_ESP32_S3_USB_OTG) )
6575
#define USING_ESP32_S3_TIMERINTERRUPT true
66-
#elif ( ARDUINO_ESP32C3_DEV )
67-
#define USING_ESP32_C3_TIMERINTERRUPT true
76+
77+
#if (_TIMERINTERRUPT_LOGLEVEL_ > 3)
78+
#warning USING_ESP32_S3_TIMERINTERRUPT
79+
#endif
80+
#elif ( defined(ARDUINO_ESP32C3_DEV) || defined(ARDUINO_LOLIN_C3_MINI) || defined(ARDUINO_ADAFRUIT_QTPY_ESP32C3) || \
81+
defined(ARDUINO_AirM2M_CORE_ESP32C3) || defined(ARDUINO_XIAO_ESP32C3) )
82+
#define USING_ESP32_C3_TIMERINTERRUPT true
83+
84+
#if (_TIMERINTERRUPT_LOGLEVEL_ > 3)
85+
#warning USING_ESP32_C3_TIMERINTERRUPT
86+
#endif
6887
#elif defined(ESP32)
69-
#define USING_ESP32_TIMERINTERRUPT true
88+
#define USING_ESP32_TIMERINTERRUPT true
89+
90+
#if (_TIMERINTERRUPT_LOGLEVEL_ > 3)
91+
#warning USING_ESP32_TIMERINTERRUPT
92+
#endif
7093
#else
7194
#error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting.
7295
#endif
7396

7497
#ifndef ESP32_TIMER_INTERRUPT_VERSION
75-
#define ESP32_TIMER_INTERRUPT_VERSION "ESP32TimerInterrupt v2.1.0"
98+
#define ESP32_TIMER_INTERRUPT_VERSION "ESP32TimerInterrupt v2.2.0"
7699

77100
#define ESP32_TIMER_INTERRUPT_VERSION_MAJOR 2
78-
#define ESP32_TIMER_INTERRUPT_VERSION_MINOR 1
101+
#define ESP32_TIMER_INTERRUPT_VERSION_MINOR 2
79102
#define ESP32_TIMER_INTERRUPT_VERSION_PATCH 0
80103

81-
#define ESP32_TIMER_INTERRUPT_VERSION_INT 2001000
104+
#define ESP32_TIMER_INTERRUPT_VERSION_INT 2002000
82105
#endif
83106

84107
#ifndef TIMER_INTERRUPT_DEBUG
@@ -254,8 +277,11 @@ class ESP32TimerInterrupt
254277
.counter_en = TIMER_START, //starts counting counter once timer_init called
255278
.intr_type = TIMER_INTR_MAX,
256279
.counter_dir = TIMER_COUNT_UP, //counts from 0 to counter value
257-
.auto_reload = TIMER_AUTORELOAD_EN, // reloads counter automatically
258-
.divider = TIMER_DIVIDER
280+
.auto_reload = TIMER_AUTORELOAD_EN, //reloads counter automatically
281+
.divider = TIMER_DIVIDER,
282+
#if SOC_TIMER_GROUP_SUPPORT_XTAL
283+
.clk_src = TIMER_SRC_CLK_XTAL //Use XTAL as source clock
284+
#endif
259285
};
260286

261287
timer_idx_t _timerIndex;

src/ESP32_ISR_Timer-Impl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
Based on BlynkTimer.h
2929
Author: Volodymyr Shymanskyy
3030
31-
Version: 2.1.0
31+
Version: 2.2.0
3232
3333
Version Modified By Date Comments
3434
------- ----------- ---------- -----------
@@ -47,6 +47,7 @@
4747
2.0.1 K Hoang 13/03/2022 Add example to demo how to use one-shot ISR-based timers. Optimize code
4848
2.0.2 K Hoang 16/06/2022 Add support to new Adafruit boards
4949
2.1.0 K Hoang 03/08/2022 Suppress errors and warnings for new ESP32 core
50+
2.2.0 K Hoang 11/08/2022 Add support and suppress warnings for ESP32_C3, ESP32_S2 and ESP32_S3 boards
5051
*****************************************************************************************************************************/
5152

5253
#pragma once

0 commit comments

Comments
 (0)