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

Commit 9f1a7e8

Browse files
authored
v1.10.0 to use latest ESP32 version
### Major Releases v1.10.0 1. Update to use latest versions of ESP32_New_TimerInterrupt Library - [ESP32_New_TimerInterrupt v1.3.0](https://github.com/khoih-prog/ESP32_New_TimerInterrupt) 2. Update `Packages_Patches`
1 parent 497bd4a commit 9f1a7e8

File tree

54 files changed

+364
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+364
-153
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Please ensure to specify the following:
2727

2828
```
2929
Arduino IDE version: 1.8.19
30-
MBED RP2040 core v3.0.1
30+
MBED RP2040 core v3.1.1
3131
RASPBERRY_PI_PICO Module
3232
OS: Ubuntu 20.04 LTS
33-
Linux xy-Inspiron-3593 5.13.0-40-generic #45~20.04.1-Ubuntu SMP Mon Apr 4 09:38:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
33+
Linux xy-Inspiron-3593 5.15.0-41-generic #44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3434
3535
Context:
3636
I encountered a crash while trying to use the Timer Interrupt.
@@ -52,3 +52,4 @@ There are usually some outstanding feature requests in the [existing issues list
5252

5353
Pull Requests with changes and fixes are also welcome!
5454

55+

README.md

Lines changed: 39 additions & 39 deletions
Large diffs are not rendered by default.

changelog.md

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

1414
* [Changelog](#changelog)
15+
* [Major Releases v1.10.0](#major-releases-v1100)
1516
* [Major Releases v1.9.0](#major-releases-v190)
1617
* [Major Releases v1.8.0](#major-releases-v180)
1718
* [Releases v1.7.0](#releases-v170)
@@ -30,6 +31,15 @@
3031

3132
## Changelog
3233

34+
### Major Releases v1.10.0
35+
36+
1. Update to use latest versions of ESP32_New_TimerInterrupt Library
37+
38+
- [ESP32_New_TimerInterrupt v1.3.0](https://github.com/khoih-prog/ESP32_New_TimerInterrupt)
39+
40+
2. Update `Packages_Patches`
41+
42+
3343
### Major Releases v1.9.0
3444

3545
1. Update to use latest versions of these TimerInterrupt Libraries

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "TimerInterrupt_Generic",
3-
"version": "1.9.0",
3+
"version": "1.10.0",
44
"keywords": "timing, device, control, timer, interrupt, hardware, isr, hardware-timer, mbed, rp2040, esp8266, esp32, samd, nrf52, teensy, stm32, nano-33-ble, nano-rp2040-connect, mega, sam-due, isr-based, 32u4, non-blocking, mission-critical, accuracy, precise",
55
"description": "This library enables you to use Interrupt from Hardware Timers on supported boards such as AVR, Mega-AVR, ESP8266, ESP32, ESP32-S2, SAMD, SAM DUE, nRF52, STM32F/L/H/G/WB/MP1, Teensy, Nano-33-BLE, RP2040-based boards, etc. These hardware timers, using interrupt, still work even if other functions are blocking. 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. 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=TimerInterrupt_Generic
2-
version=1.9.0
2+
version=1.10.0
33
author=Khoi Hoang <[email protected]>
44
maintainer=Khoi Hoang <[email protected]>
55
license=MIT

platformio/platformio.ini

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
; chose environment:
1515
; ESP8266
1616
; ESP32
17+
; esp32s2
18+
; esp32s3
19+
; esp32c3
1720
; SAMD
1821
; DUE
1922
; NRF52
@@ -26,9 +29,9 @@
2629

2730
; ============================================================
2831
;default_envs = ESP8266
29-
;default_envs = ESP32
32+
default_envs = ESP32
3033
;default_envs = SAMD
31-
default_envs = DUE
34+
;default_envs = DUE
3235
;default_envs = NRF52
3336
;default_envs = STM32
3437
;default_envs = AVR
@@ -128,6 +131,7 @@ board = nodemcuv2
128131
[env:ESP32]
129132
platform = espressif32
130133
framework = arduino
134+
131135
; ============================================================
132136
; Board configuration
133137
; choose your board by uncommenting one of the following lines
@@ -166,6 +170,76 @@ board = esp32doit-devkit-v1
166170
;board = iotbusproteus
167171
;board = nina_w10
168172

173+
; ============================================================
174+
175+
[env:esp32s2]
176+
platform = espressif32
177+
framework = arduino
178+
179+
; toolchain download links see
180+
; refer "name": "xtensa-esp32s2-elf-gcc","version": "gcc8_4_0-esp-2021r1" section of
181+
; https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
182+
; e.g. Windows: https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-win32.zip
183+
platform_packages =
184+
toolchain-xtensa32s2@file://C:\Users\Max\Downloads\xtensa-esp32s2-elf
185+
framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#a4118ea88987c28aac3a49bcb9cc5d6c0acc6f3f
186+
platformio/tool-esptoolpy @ ~1.30100
187+
framework = arduino
188+
board = esp32dev
189+
board_build.mcu = esp32s2
190+
board_build.partitions = huge_app.csv
191+
board_build.variant = esp32s2
192+
board_build.f_cpu = 240000000L
193+
board_build.f_flash = 80000000L
194+
board_build.flash_mode = qio
195+
board_build.arduino.ldscript = esp32s2_out.ld
196+
build_unflags =
197+
-DARDUINO_ESP32_DEV
198+
-DARDUINO_VARIANT="esp32"
199+
build_flags =
200+
-DARDUINO_ESP32S2_DEV
201+
-DARDUINO_VARIANT="esp32s2"
202+
203+
; ============================================================
204+
205+
[env:esp32s3]
206+
platform = espressif32
207+
framework = arduino
208+
209+
board_build.mcu = esp32s3
210+
board_build.partitions = huge_app.csv
211+
board_build.variant = esp32s3
212+
board_build.f_cpu = 240000000L
213+
board_build.f_flash = 80000000L
214+
board_build.flash_mode = qio
215+
board_build.arduino.ldscript = esp32s3_out.ld
216+
build_unflags =
217+
-DARDUINO_ESP32_DEV
218+
-DARDUINO_VARIANT="esp32"
219+
build_flags =
220+
-DARDUINO_ESP32S3_DEV
221+
-DARDUINO_VARIANT="esp32s3"
222+
223+
; ============================================================
224+
225+
[env:esp32sc3]
226+
platform = espressif32
227+
framework = arduino
228+
229+
board_build.mcu = esp32c3
230+
board_build.partitions = huge_app.csv
231+
board_build.variant = esp32c3
232+
board_build.f_cpu = 160000000L
233+
board_build.f_flash = 80000000L
234+
board_build.flash_mode = qio
235+
board_build.arduino.ldscript = esp32c3_out.ld
236+
build_unflags =
237+
-DARDUINO_ESP32_DEV
238+
-DARDUINO_VARIANT="esp32"
239+
build_flags =
240+
-DARDUINO_ESP32S3_DEV
241+
-DARDUINO_VARIANT="esp32c3"
242+
169243
; ============================================================
170244
; ============================================================
171245

src/AVRTimerInterrupt_Generic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2727
Licensed under MIT license
2828
29-
Version: 1.9.0
29+
Version: 1.10.0
3030
3131
Version Modified By Date Comments
3232
------- ----------- ---------- -----------
@@ -41,6 +41,7 @@
4141
1.7.0 K.Hoang 13/08/2021 Add support to Adafruit nRF52 core v0.22.0+
4242
1.8.0 K.Hoang 24/11/2021 Update to use latest TimerInterrupt Libraries' versions
4343
1.9.0 K.Hoang 09/05/2022 Update to use latest TimerInterrupt Libraries' versions
44+
1.10.0 K.Hoang 10/08/2022 Update to use latest ESP32_New_TimerInterrupt Library version
4445
*****************************************************************************************************************************/
4546

4647

src/ESP32TimerInterrupt_Generic.h

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
Based on BlynkTimer.h
2929
Author: Volodymyr Shymanskyy
3030
31-
Version: 1.9.0
31+
Version: 1.10.0
3232
3333
Version Modified By Date Comments
3434
------- ----------- ---------- -----------
@@ -43,6 +43,7 @@
4343
1.7.0 K.Hoang 13/08/2021 Add support to Adafruit nRF52 core v0.22.0+
4444
1.8.0 K.Hoang 24/11/2021 Update to use latest TimerInterrupt Libraries' versions
4545
1.9.0 K.Hoang 09/05/2022 Update to use latest TimerInterrupt Libraries' versions
46+
1.10.0 K.Hoang 10/08/2022 Update to use latest ESP32_New_TimerInterrupt Library version
4647
*****************************************************************************************************************************/
4748

4849
#pragma once
@@ -51,11 +52,12 @@
5152
#define ESP32_NEW_TIMERINTERRUPT_H
5253

5354
#if ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \
54-
ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \
55-
ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM )
55+
ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \
56+
ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM || ARDUINO_ADAFRUIT_QTPY_ESP32S2)
5657
#define USING_ESP32_S2_NEW_TIMERINTERRUPT true
5758
#elif ( defined(ARDUINO_ESP32S3_DEV) || defined(ARDUINO_ESP32_S3_BOX) || defined(ARDUINO_TINYS3) || \
58-
defined(ARDUINO_PROS3) || defined(ARDUINO_FEATHERS3) )
59+
defined(ARDUINO_PROS3) || defined(ARDUINO_FEATHERS3) || defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_NOPSRAM) || \
60+
defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_NOPSRAM))
5961
#define USING_ESP32_S3_NEW_TIMERINTERRUPT true
6062
#elif ( ARDUINO_ESP32C3_DEV )
6163
#define USING_ESP32_C3_NEW_TIMERINTERRUPT true
@@ -66,13 +68,13 @@
6668
#endif
6769

6870
#ifndef ESP32_TIMER_INTERRUPT_VERSION
69-
#define ESP32_TIMER_INTERRUPT_VERSION "ESP32_New_TimerInterrupt v1.2.0"
71+
#define ESP32_TIMER_INTERRUPT_VERSION "ESP32_New_TimerInterrupt v1.3.0"
7072

7173
#define ESP32_TIMER_INTERRUPT_VERSION_MAJOR 1
72-
#define ESP32_TIMER_INTERRUPT_VERSION_MINOR 2
74+
#define ESP32_TIMER_INTERRUPT_VERSION_MINOR 3
7375
#define ESP32_TIMER_INTERRUPT_VERSION_PATCH 0
7476

75-
#define ESP32_TIMER_INTERRUPT_VERSION_INT 1002000
77+
#define ESP32_TIMER_INTERRUPT_VERSION_INT 1003000
7678
#endif
7779

7880
#ifndef TIMER_INTERRUPT_DEBUG
@@ -93,8 +95,8 @@
9395
9496
typedef enum
9597
{
96-
TIMER_GROUP_0 = 0, /*!<Hw timer group 0
97-
TIMER_GROUP_1 = 1, /*!<Hw timer group 1
98+
TIMER_GROUP_0 = 0, // Hw timer group 0
99+
TIMER_GROUP_1 = 1, // Hw timer group 1
98100
TIMER_GROUP_MAX,
99101
} timer_group_t;
100102
@@ -103,8 +105,8 @@ typedef enum
103105
104106
typedef enum
105107
{
106-
TIMER_0 = 0, /*!<Select timer0 of GROUPx
107-
TIMER_1 = 1, /*!<Select timer1 of GROUPx
108+
TIMER_0 = 0, // Select timer0 of GROUPx
109+
TIMER_1 = 1, // Select timer1 of GROUPx
108110
TIMER_MAX,
109111
} timer_idx_t;
110112
@@ -172,6 +174,28 @@ typedef struct
172174
173175
*/
174176

177+
/*
178+
//ESP32 core v2.0.4, timer_config_t defined in tools/sdk/esp32/include/hal/include/hal/timer_types.h:
179+
#if SOC_TIMER_GROUP_SUPPORT_XTAL
180+
typedef enum {
181+
TIMER_SRC_CLK_APB = 0, // Select APB as the source clock
182+
TIMER_SRC_CLK_XTAL = 1, // Select XTAL as the source clock
183+
} timer_src_clk_t;
184+
#endif
185+
typedef struct {
186+
timer_alarm_t alarm_en; // Timer alarm enable
187+
timer_start_t counter_en; // Counter enable
188+
timer_intr_mode_t intr_type; // Interrupt mode
189+
timer_count_dir_t counter_dir; // Counter direction
190+
timer_autoreload_t auto_reload; // Timer auto-reload
191+
uint32_t divider; // Counter clock divider. The divider's range is from from 2 to 65536
192+
#if SOC_TIMER_GROUP_SUPPORT_XTAL
193+
timer_src_clk_t clk_src; // Use XTAL as source clock
194+
#endif
195+
} timer_config_t;
196+
197+
*/
198+
175199
class ESP32TimerInterrupt;
176200

177201
typedef ESP32TimerInterrupt ESP32Timer;
@@ -220,8 +244,11 @@ class ESP32TimerInterrupt
220244
.counter_en = TIMER_START, //starts counting counter once timer_init called
221245
.intr_type = TIMER_INTR_MAX,
222246
.counter_dir = TIMER_COUNT_UP, //counts from 0 to counter value
223-
.auto_reload = TIMER_AUTORELOAD_EN, // reloads counter automatically
224-
.divider = TIMER_DIVIDER
247+
.auto_reload = TIMER_AUTORELOAD_EN, //reloads counter automatically
248+
.divider = TIMER_DIVIDER,
249+
#if SOC_TIMER_GROUP_SUPPORT_XTAL
250+
.clk_src = TIMER_SRC_CLK_XTAL //Use XTAL as source clock
251+
#endif
225252
};
226253

227254
timer_idx_t _timerIndex;

src/ESP8266TimerInterrupt_Generic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2525
Licensed under MIT license
2626
27-
Version: 1.9.0
27+
Version: 1.10.0
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -39,6 +39,7 @@
3939
1.7.0 K.Hoang 13/08/2021 Add support to Adafruit nRF52 core v0.22.0+
4040
1.8.0 K.Hoang 24/11/2021 Update to use latest TimerInterrupt Libraries' versions
4141
1.9.0 K.Hoang 09/05/2022 Update to use latest TimerInterrupt Libraries' versions
42+
1.10.0 K.Hoang 10/08/2022 Update to use latest ESP32_New_TimerInterrupt Library version
4243
*****************************************************************************************************************************/
4344

4445
#pragma once

src/ISR_Timer-Impl_Generic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2020
Licensed under MIT license
2121
22-
Version: 1.9.0
22+
Version: 1.10.0
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -34,6 +34,7 @@
3434
1.7.0 K.Hoang 13/08/2021 Add support to Adafruit nRF52 core v0.22.0+
3535
1.8.0 K.Hoang 24/11/2021 Update to use latest TimerInterrupt Libraries' versions
3636
1.9.0 K.Hoang 09/05/2022 Update to use latest TimerInterrupt Libraries' versions
37+
1.10.0 K.Hoang 10/08/2022 Update to use latest ESP32_New_TimerInterrupt Library version
3738
*****************************************************************************************************************************/
3839

3940
#pragma once

0 commit comments

Comments
 (0)