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

Commit 3773b8a

Browse files
authored
v1.7.0 to add support to more boards
### Releases v1.7.0 1. Add support to - ESP32_C3 : LOLIN_C3_MINI, DFROBOT_BEETLE_ESP32_C3, ADAFRUIT_QTPY_ESP32C3, AirM2M_CORE_ESP32C3, XIAO_ESP32C3
1 parent 10918f2 commit 3773b8a

11 files changed

+120
-28
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Please ensure to specify the following:
1616

1717
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
1818
* `ESP32` Core Version (e.g. ESP32 core v2.0.4)
19-
* `ESP32-C3` Board type (e.g. ESP32C3_DEV Module, etc.)
19+
* `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.)
2020
* Contextual information (e.g. what you were trying to achieve)
2121
* Simplest possible steps to reproduce
2222
* Anything that might be relevant in your opinion, such as:

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
113113

114114
### Currently supported Boards
115115

116-
1. ESP32_C3-based boards, such as ESP32C3_DEV, etc
116+
1. ESP32_C3-based boards, such as ESP32C3_DEV, LOLIN_C3_MINI, DFROBOT_BEETLE_ESP32_C3, ADAFRUIT_QTPY_ESP32C3, AirM2M_CORE_ESP32C3, XIAO_ESP32C3, etc.
117+
117118

118119
---
119120

@@ -344,7 +345,7 @@ void setup()
344345

345346
### Example [TimerInterruptTest](examples/TimerInterruptTest)
346347

347-
https://github.com/khoih-prog/ESP32_C3_TimerInterrupt/blob/06ea22be5dd44b06b3778b6c999eb845294334cc/examples/TimerInterruptTest/TimerInterruptTest.ino#L40-L175
348+
https://github.com/khoih-prog/ESP32_C3_TimerInterrupt/blob/10918f2620be6786c6d8b9447ce4e93ed2c90928/examples/TimerInterruptTest/TimerInterruptTest.ino#L40-L171
348349

349350
---
350351
---
@@ -357,7 +358,7 @@ The following is the sample terminal output when running example [ISR_16_Timers_
357358

358359
```
359360
Starting ISR_16_Timers_Array_Complex on ESP32C3_DEV
360-
ESP32_C3_TimerInterrupt v1.6.0
361+
ESP32_C3_TimerInterrupt v1.7.0
361362
CPU Frequency = 160 MHz
362363
[TISR] ESP32_C3_TimerInterrupt: _timerNo = 1, TIM_CLOCK_FREQ = 1000000.00
363364
[TISR] TIMER_BASE_CLK = 80000000, TIMER_DIVIDER = 80
@@ -511,7 +512,7 @@ The following is the sample terminal output when running example [TimerInterrupt
511512

512513
```
513514
Starting TimerInterruptTest on ESP32C3_DEV
514-
ESP32_C3_TimerInterrupt v1.6.0
515+
ESP32_C3_TimerInterrupt v1.7.0
515516
CPU Frequency = 160 MHz
516517
[TISR] ESP32_C3_TimerInterrupt: _timerNo = 0, TIM_CLOCK_FREQ = 1000000.00
517518
[TISR] TIMER_BASE_CLK = 80000000, TIMER_DIVIDER = 80
@@ -544,7 +545,7 @@ The following is the sample terminal output when running example [Change_Interva
544545

545546
```
546547
Starting Change_Interval on ESP32C3_DEV
547-
ESP32_C3_TimerInterrupt v1.6.0
548+
ESP32_C3_TimerInterrupt v1.7.0
548549
CPU Frequency = 160 MHz
549550
[TISR] ESP32_C3_TimerInterrupt: _timerNo = 0, TIM_CLOCK_FREQ = 1000000.00
550551
[TISR] TIMER_BASE_CLK = 80000000, TIMER_DIVIDER = 80
@@ -582,7 +583,7 @@ The following is the sample terminal output when running example [Argument_None]
582583

583584
```
584585
Starting Argument_None on ESP32C3_DEV
585-
ESP32_C3_TimerInterrupt v1.6.0
586+
ESP32_C3_TimerInterrupt v1.7.0
586587
CPU Frequency = 160 MHz
587588
[TISR] ESP32_C3_TimerInterrupt: _timerNo = 0, TIM_CLOCK_FREQ = 1000000.00
588589
[TISR] TIMER_BASE_CLK = 80000000, TIMER_DIVIDER = 80
@@ -650,7 +651,9 @@ Submit issues to: [ESP32_C3_TimerInterrupt issues](https://github.com/khoih-prog
650651
8. Avoid deprecated functions.
651652
9. Optimize library code by using `reference-passing` instead of `value-passing`
652653
10. Suppress errors and warnings for new ESP32 core v2.0.4+
653-
654+
11. Add support to
655+
- ESP32_C3 : LOLIN_C3_MINI, DFROBOT_BEETLE_ESP32_C3, ADAFRUIT_QTPY_ESP32C3, AirM2M_CORE_ESP32C3, XIAO_ESP32C3
656+
654657
---
655658
---
656659

changelog.md

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

1515
* [Changelog](#changelog)
16+
* [Releases v1.7.0](#releases-v170)
1617
* [Releases v1.6.0](#releases-v160)
1718
* [Releases v1.5.0](#releases-v150)
1819
* [Releases v1.4.0](#releases-v140)
@@ -22,6 +23,11 @@
2223

2324
## Changelog
2425

26+
### Releases v1.7.0
27+
28+
1. Add support to
29+
- ESP32_C3 : LOLIN_C3_MINI, DFROBOT_BEETLE_ESP32_C3, ADAFRUIT_QTPY_ESP32C3, AirM2M_CORE_ESP32C3, XIAO_ESP32C3
30+
2531
### Releases v1.6.0
2632

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

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ESP32_C3_TimerInterrupt",
3-
"version": "1.6.0",
3+
"version": "1.7.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-c3",
55
"description": "This library enables you to use Interrupt from Hardware Timers on an ESP32-C3-based board. 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=ESP32_C3_TimerInterrupt
2-
version=1.6.0
2+
version=1.7.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 an ESP32-C3-based board

platformio/platformio.ini

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
; ============================================================
1313
; chose environment:
1414
; ESP32
15+
; esp32s2
16+
; esp32s3
17+
; esp32c3
18+
1519
; ============================================================
16-
default_envs = ESP32
20+
default_envs = esp32c3
1721

1822
[env]
1923
; ============================================================
@@ -38,6 +42,10 @@ build_flags =
3842
; comment the folowing line to enable WiFi debugging
3943
-D NDEBUG
4044

45+
46+
; ============================================================
47+
; ============================================================
48+
4149
[env:ESP32]
4250
platform = espressif32
4351
framework = arduino
@@ -79,3 +87,75 @@ board = esp32doit-devkit-v1
7987
;board = iotbusio
8088
;board = iotbusproteus
8189
;board = nina_w10
90+
91+
; ============================================================
92+
93+
[env:esp32s2]
94+
platform = espressif32
95+
framework = arduino
96+
97+
; toolchain download links see
98+
; refer "name": "xtensa-esp32s2-elf-gcc","version": "gcc8_4_0-esp-2021r1" section of
99+
; https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
100+
; e.g. Windows: https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-win32.zip
101+
platform_packages =
102+
toolchain-xtensa32s2@file://C:\Users\Max\Downloads\xtensa-esp32s2-elf
103+
framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#a4118ea88987c28aac3a49bcb9cc5d6c0acc6f3f
104+
platformio/tool-esptoolpy @ ~1.30100
105+
framework = arduino
106+
board = esp32dev
107+
board_build.mcu = esp32s2
108+
board_build.partitions = huge_app.csv
109+
board_build.variant = esp32s2
110+
board_build.f_cpu = 240000000L
111+
board_build.f_flash = 80000000L
112+
board_build.flash_mode = qio
113+
board_build.arduino.ldscript = esp32s2_out.ld
114+
build_unflags =
115+
-DARDUINO_ESP32_DEV
116+
-DARDUINO_VARIANT="esp32"
117+
build_flags =
118+
-DARDUINO_ESP32S2_DEV
119+
-DARDUINO_VARIANT="esp32s2"
120+
121+
; ============================================================
122+
123+
[env:esp32s3]
124+
platform = espressif32
125+
framework = arduino
126+
127+
board_build.mcu = esp32s3
128+
board_build.partitions = huge_app.csv
129+
board_build.variant = esp32s3
130+
board_build.f_cpu = 240000000L
131+
board_build.f_flash = 80000000L
132+
board_build.flash_mode = qio
133+
board_build.arduino.ldscript = esp32s3_out.ld
134+
build_unflags =
135+
-DARDUINO_ESP32_DEV
136+
-DARDUINO_VARIANT="esp32"
137+
build_flags =
138+
-DARDUINO_ESP32S3_DEV
139+
-DARDUINO_VARIANT="esp32s3"
140+
141+
; ============================================================
142+
143+
[env:esp32c3]
144+
platform = espressif32
145+
framework = arduino
146+
147+
board_build.mcu = esp32c3
148+
board_build.partitions = huge_app.csv
149+
board_build.variant = esp32c3
150+
board_build.f_cpu = 160000000L
151+
board_build.f_flash = 80000000L
152+
board_build.flash_mode = qio
153+
board_build.arduino.ldscript = esp32c3_out.ld
154+
build_unflags =
155+
-DARDUINO_ESP32_DEV
156+
-DARDUINO_VARIANT="esp32"
157+
build_flags =
158+
-DARDUINO_ESP32S3_DEV
159+
-DARDUINO_VARIANT="esp32c3"
160+
161+
; ============================================================

src/ESP32_C3_ISR_Timer-Impl.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,21 @@
2424
Based on BlynkTimer.h
2525
Author: Volodymyr Shymanskyy
2626
27-
Version: 1.6.0
27+
Version: 1.7.0
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
3131
1.4.0 K Hoang 29/07/2021 Initial coding. Sync with ESP32_S2_TimerInterrupt v1.4.0
3232
1.5.0 K.Hoang 23/01/2022 Avoid deprecated functions. Fix `multiple-definitions` linker error
3333
1.6.0 K Hoang 10/08/2022 Suppress errors and warnings for new ESP32 core
34+
1.7.0 K Hoang 11/08/2022 Suppress warnings and add support for more ESP32_C3 boards
3435
*****************************************************************************************************************************/
3536

3637
#pragma once
3738

3839
#ifndef ISR_TIMER_GENERIC_IMPL_H
3940
#define ISR_TIMER_GENERIC_IMPL_H
4041

41-
#if !( ARDUINO_ESP32C3_DEV )
42-
#error This code is intended to run on the ESP32-C3 platform! Please check your Tools->Board setting.
43-
#endif
44-
4542
#include <string.h>
4643

4744
ESP32_ISR_Timer::ESP32_ISR_Timer()

src/ESP32_C3_ISR_Timer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@
2424
Based on BlynkTimer.h
2525
Author: Volodymyr Shymanskyy
2626
27-
Version: 1.6.0
27+
Version: 1.7.0
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
3131
1.4.0 K Hoang 29/07/2021 Initial coding. Sync with ESP32_S2_TimerInterrupt v1.4.0
3232
1.5.0 K.Hoang 23/01/2022 Avoid deprecated functions. Fix `multiple-definitions` linker error
3333
1.6.0 K Hoang 10/08/2022 Suppress errors and warnings for new ESP32 core
34+
1.7.0 K Hoang 11/08/2022 Suppress warnings and add support for more ESP32_C3 boards
3435
*****************************************************************************************************************************/
3536

3637
#pragma once

src/ESP32_C3_ISR_Timer.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,34 @@
2424
Based on BlynkTimer.h
2525
Author: Volodymyr Shymanskyy
2626
27-
Version: 1.6.0
27+
Version: 1.7.0
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
3131
1.4.0 K Hoang 29/07/2021 Initial coding. Sync with ESP32_S2_TimerInterrupt v1.4.0
3232
1.5.0 K.Hoang 23/01/2022 Avoid deprecated functions. Fix `multiple-definitions` linker error
3333
1.6.0 K Hoang 10/08/2022 Suppress errors and warnings for new ESP32 core
34+
1.7.0 K Hoang 11/08/2022 Suppress warnings and add support for more ESP32_C3 boards
3435
*****************************************************************************************************************************/
3536

3637
#pragma once
3738

3839
#ifndef ISR_TIMER_GENERIC_HPP
3940
#define ISR_TIMER_GENERIC_HPP
4041

41-
#if !( ARDUINO_ESP32C3_DEV )
42+
#if !( defined(ARDUINO_ESP32C3_DEV) || defined(ARDUINO_LOLIN_C3_MINI) || defined(ARDUINO_ADAFRUIT_QTPY_ESP32C3) || \
43+
defined(ARDUINO_AirM2M_CORE_ESP32C3) || defined(ARDUINO_XIAO_ESP32C3) )
4244
#error This code is intended to run on the ESP32-C3 platform! Please check your Tools->Board setting.
4345
#endif
4446

4547
#ifndef ESP32_C3_TIMER_INTERRUPT_VERSION
46-
#define ESP32_C3_TIMER_INTERRUPT_VERSION "ESP32_C3_TimerInterrupt v1.6.0"
48+
#define ESP32_C3_TIMER_INTERRUPT_VERSION "ESP32_C3_TimerInterrupt v1.7.0"
4749

4850
#define ESP32_C3_TIMER_INTERRUPT_VERSION_MAJOR 1
49-
#define ESP32_C3_TIMER_INTERRUPT_VERSION_MINOR 6
51+
#define ESP32_C3_TIMER_INTERRUPT_VERSION_MINOR 7
5052
#define ESP32_C3_TIMER_INTERRUPT_VERSION_PATCH 0
5153

52-
#define ESP32_C3_TIMER_INTERRUPT_VERSION_INT 1006000
54+
#define ESP32_C3_TIMER_INTERRUPT_VERSION_INT 1007000
5355
#endif
5456

5557
#include "TimerInterrupt_Generic_Debug.h"

src/ESP32_C3_TimerInterrupt.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,36 @@
2525
Based on BlynkTimer.h
2626
Author: Volodymyr Shymanskyy
2727
28-
Version: 1.6.0
28+
Version: 1.7.0
2929
3030
Version Modified By Date Comments
3131
------- ----------- ---------- -----------
3232
1.4.0 K Hoang 29/07/2021 Initial coding. Sync with ESP32_S2_TimerInterrupt v1.4.0
3333
1.5.0 K.Hoang 23/01/2022 Avoid deprecated functions. Fix `multiple-definitions` linker error
3434
1.6.0 K Hoang 10/08/2022 Suppress errors and warnings for new ESP32 core
35+
1.7.0 K Hoang 11/08/2022 Suppress warnings and add support for more ESP32_C3 boards
3536
*****************************************************************************************************************************/
3637

3738
#pragma once
3839

3940
#ifndef ESP32_C3_TIMERINTERRUPT_H
4041
#define ESP32_C3_TIMERINTERRUPT_H
4142

42-
#if !( ARDUINO_ESP32C3_DEV )
43+
#if !( defined(ARDUINO_ESP32C3_DEV) || defined(ARDUINO_LOLIN_C3_MINI) || defined(ARDUINO_ADAFRUIT_QTPY_ESP32C3) || \
44+
defined(ARDUINO_AirM2M_CORE_ESP32C3) || defined(ARDUINO_XIAO_ESP32C3) )
4345
#error This code is intended to run on the ESP32-C3 platform! Please check your Tools->Board setting.
4446
#else
4547
#define USING_ESP32_C3_TIMER_INTERRUPT true
4648
#endif
4749

4850
#ifndef ESP32_C3_TIMER_INTERRUPT_VERSION
49-
#define ESP32_C3_TIMER_INTERRUPT_VERSION "ESP32_C3_TimerInterrupt v1.6.0"
51+
#define ESP32_C3_TIMER_INTERRUPT_VERSION "ESP32_C3_TimerInterrupt v1.7.0"
5052

5153
#define ESP32_C3_TIMER_INTERRUPT_VERSION_MAJOR 1
52-
#define ESP32_C3_TIMER_INTERRUPT_VERSION_MINOR 6
54+
#define ESP32_C3_TIMER_INTERRUPT_VERSION_MINOR 7
5355
#define ESP32_C3_TIMER_INTERRUPT_VERSION_PATCH 0
5456

55-
#define ESP32_C3_TIMER_INTERRUPT_VERSION_INT 1006000
57+
#define ESP32_C3_TIMER_INTERRUPT_VERSION_INT 1007000
5658
#endif
5759

5860
#ifndef TIMER_INTERRUPT_DEBUG

0 commit comments

Comments
 (0)