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

Commit bf025f2

Browse files
authored
v1.3.2 to remove crashing PIN_D24
### Releases v1.3.2 1. Remove crashing `PIN_D24` from examples
1 parent aa86755 commit bf025f2

File tree

15 files changed

+54
-37
lines changed

15 files changed

+54
-37
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 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.19) or Platform.io version
18-
* `ESP32` Core Version (e.g. ESP32 core v2.0.2)
18+
* `ESP32` Core Version (e.g. ESP32 core v2.0.3)
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.)
@@ -31,10 +31,10 @@ Please ensure to specify the following:
3131

3232
```
3333
Arduino IDE version: 1.8.19
34-
ESP32 core v2.0.2
34+
ESP32 core v2.0.3
3535
ESP32S3_DEV Module
3636
OS: Ubuntu 20.04 LTS
37-
Linux xy-Inspiron-3593 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
37+
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
3838
3939
Context:
4040
I encountered a crash while using TimerInterrupt.

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
147147
## Prerequisites
148148

149149
1. [`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [![GitHub release](https://img.shields.io/github/release/arduino/Arduino.svg)](https://github.com/arduino/Arduino/releases/latest)
150-
2. [`ESP32 Core 2.0.2+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/).
150+
2. [`ESP32 Core 2.0.3+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/).
151151
3. [`SimpleTimer library`](https://github.com/jfturcot/SimpleTimer) to use with some examples.
152152

153153

@@ -309,7 +309,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
309309

310310
```
311311
Starting ISR_16_PWMs_Array_Complex on ESP32_DEV
312-
ESP32_PWM v1.3.1
312+
ESP32_PWM v1.3.2
313313
CPU Frequency = 240 MHz
314314
[PWM] ESP32_TimerInterrupt: _timerNo = 1 , _fre = 1000000
315315
[PWM] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -377,7 +377,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
377377

378378
```
379379
Starting ISR_16_PWMs_Array on ESP32_DEV
380-
ESP32_PWM v1.3.1
380+
ESP32_PWM v1.3.2
381381
CPU Frequency = 240 MHz
382382
[PWM] ESP32_TimerInterrupt: _timerNo = 1 , _fre = 1000000
383383
[PWM] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -412,7 +412,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
412412

413413
```
414414
Starting ISR_16_PWMs_Array_Simple on ESP32_DEV
415-
ESP32_PWM v1.3.1
415+
ESP32_PWM v1.3.2
416416
CPU Frequency = 240 MHz
417417
[PWM] ESP32_TimerInterrupt: _timerNo = 1 , _fre = 1000000
418418
[PWM] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -446,7 +446,7 @@ The following is the sample terminal output when running example [ISR_Modify_PWM
446446

447447
```
448448
Starting ISR_Modify_PWM on ESP32_DEV
449-
ESP32_PWM v1.3.1
449+
ESP32_PWM v1.3.2
450450
CPU Frequency = 240 MHz
451451
[PWM] ESP32_TimerInterrupt: _timerNo = 1 , _fre = 1000000
452452
[PWM] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -482,7 +482,7 @@ The following is the sample terminal output when running example [ISR_Changing_P
482482

483483
```
484484
Starting ISR_Changing_PWM on ESP32_DEV
485-
ESP32_PWM v1.3.1
485+
ESP32_PWM v1.3.2
486486
CPU Frequency = 240 MHz
487487
[PWM] ESP32_TimerInterrupt: _timerNo = 1 , _fre = 1000000
488488
[PWM] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -516,7 +516,7 @@ The following is the sample terminal output when running example [ISR_Modify_PWM
516516

517517
```
518518
Starting ISR_Modify_PWM on ESP32S2_DEV
519-
ESP32_PWM v1.3.1
519+
ESP32_PWM v1.3.2
520520
CPU Frequency = 240 MHz
521521
[PWM] ESP32_S2_TimerInterrupt: _timerNo = 1 , _fre = 1000000
522522
[PWM] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -552,7 +552,7 @@ The following is the sample terminal output when running example [ISR_Changing_P
552552

553553
```
554554
Starting ISR_Changing_PWM on ESP32S2_DEV
555-
ESP32_PWM v1.3.1
555+
ESP32_PWM v1.3.2
556556
CPU Frequency = 240 MHz
557557
[PWM] ESP32_S2_TimerInterrupt: _timerNo = 1 , _fre = 1000000
558558
[PWM] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -578,7 +578,7 @@ The following is the sample terminal output when running example [ISR_Modify_PWM
578578

579579
```
580580
Starting ISR_Modify_PWM on ESP32C3_DEV
581-
ESP32_PWM v1.3.1
581+
ESP32_PWM v1.3.2
582582
CPU Frequency = 160 MHz
583583
[PWM] ESP32_TimerInterrupt: _timerNo = 1 , _fre = 1000000
584584
[PWM] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -614,7 +614,7 @@ The following is the sample terminal output when running example [ISR_Changing_P
614614

615615
```
616616
Starting ISR_Changing_PWM on ESP32C3_DEV
617-
ESP32_PWM v1.3.1
617+
ESP32_PWM v1.3.2
618618
CPU Frequency = 160 MHz
619619
[PWM] ESP32_TimerInterrupt: _timerNo = 1 , _fre = 1000000
620620
[PWM] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -643,7 +643,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
643643

644644
```
645645
Starting ISR_16_PWMs_Array_Complex on ESP32S3_DEV
646-
ESP32_PWM v1.3.1
646+
ESP32_PWM v1.3.2
647647
CPU Frequency = 240 MHz
648648
[PWM] ESP32_S3_TimerInterrupt: _timerNo = 1 , _fre = 1000000
649649
[PWM] TIMER_BASE_CLK = 80000000 , TIMER_DIVIDER = 80
@@ -774,6 +774,8 @@ Submit issues to: [ESP32_PWM issues](https://github.com/khoih-prog/ESP32_PWM/iss
774774
9. DutyCycle to be optionally updated at the end current PWM period instead of immediately.
775775
10. Add support to `ESP32-S3`
776776
11. Display informational warning only when `_PWM_LOGLEVEL_` > 3
777+
12. Remove crashing `PIN_D24` from examples
778+
777779

778780
---
779781
---

changelog.md

Lines changed: 6 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 v1.3.2](#releases-v132)
1516
* [Releases v1.3.1](#releases-v131)
1617
* [Releases v1.3.0](#releases-v130)
1718
* [Releases v1.2.2](#releases-v122)
@@ -27,6 +28,11 @@
2728

2829
## Changelog
2930

31+
### Releases v1.3.2
32+
33+
1. Remove crashing `PIN_D24` from examples
34+
35+
3036
### Releases v1.3.1
3137

3238
1. Fix `DutyCycle` bug. Check [float precisison of DutyCycle only sometimes working #3](https://github.com/khoih-prog/SAMD_Slow_PWM/issues/3)

examples/ISR_16_PWMs_Array/ISR_16_PWMs_Array.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ bool IRAM_ATTR TimerHandler(void * timerNo)
103103
#define PIN_D21 21 // Pin D21 mapped to pin GPIO21/SDA of ESP32
104104
#define PIN_D22 22 // Pin D22 mapped to pin GPIO22/SCL of ESP32
105105
#define PIN_D23 23 // Pin D23 mapped to pin GPIO23/VSPI_MOSI of ESP32
106-
#define PIN_D24 24 // Pin D24 mapped to pin GPIO24 of ESP32
107106
#define PIN_D25 25 // Pin D25 mapped to pin GPIO25/ADC18/DAC1 of ESP32
108107
#define PIN_D26 26 // Pin D26 mapped to pin GPIO26/ADC19/DAC2 of ESP32
109108
#define PIN_D27 27 // Pin D27 mapped to pin GPIO27/ADC17/TOUCH7 of ESP32
@@ -131,10 +130,11 @@ uint32_t PWM_Pin[] =
131130
PIN_D9, PIN_D10, PIN_D11, PIN_D12, PIN_D13, PIN_D14, PIN_D15, PIN_D16,
132131
};
133132
#else
133+
// Bad pins to use: PIN_D24
134134
uint32_t PWM_Pin[] =
135135
{
136-
PIN_D24, LED_BUILTIN, PIN_D3, PIN_D4, PIN_D5, PIN_D12, PIN_D13, PIN_D14,
137-
PIN_D15, PIN_D16, PIN_D17, PIN_D18, PIN_D19, PIN_D21, PIN_D22, PIN_D23
136+
LED_BUILTIN, PIN_D25, PIN_D3, PIN_D4, PIN_D5, PIN_D12, PIN_D13, PIN_D14,
137+
PIN_D15, PIN_D16, PIN_D17, PIN_D18, PIN_D19, PIN_D21, PIN_D22, PIN_D23
138138
};
139139
#endif
140140

examples/ISR_16_PWMs_Array_Complex/ISR_16_PWMs_Array_Complex.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ bool IRAM_ATTR TimerHandler(void * timerNo)
104104
#define PIN_D21 21 // Pin D21 mapped to pin GPIO21/SDA of ESP32
105105
#define PIN_D22 22 // Pin D22 mapped to pin GPIO22/SCL of ESP32
106106
#define PIN_D23 23 // Pin D23 mapped to pin GPIO23/VSPI_MOSI of ESP32
107-
#define PIN_D24 24 // Pin D24 mapped to pin GPIO24 of ESP32
108107
#define PIN_D25 25 // Pin D25 mapped to pin GPIO25/ADC18/DAC1 of ESP32
109108
#define PIN_D26 26 // Pin D26 mapped to pin GPIO26/ADC19/DAC2 of ESP32
110109
#define PIN_D27 27 // Pin D27 mapped to pin GPIO27/ADC17/TOUCH7 of ESP32
@@ -140,10 +139,11 @@ uint32_t PWM_Pin[] =
140139
PIN_D9, PIN_D10, PIN_D11, PIN_D12, PIN_D13, PIN_D14, PIN_D15, PIN_D16,
141140
};
142141
#else
142+
// Bad pins to use: PIN_D24
143143
uint32_t PWM_Pin[] =
144144
{
145-
PIN_D24, LED_BUILTIN, PIN_D3, PIN_D4, PIN_D5, PIN_D12, PIN_D13, PIN_D14,
146-
PIN_D15, PIN_D16, PIN_D17, PIN_D18, PIN_D19, PIN_D21, PIN_D22, PIN_D23
145+
LED_BUILTIN, PIN_D25, PIN_D3, PIN_D4, PIN_D5, PIN_D12, PIN_D13, PIN_D14,
146+
PIN_D15, PIN_D16, PIN_D17, PIN_D18, PIN_D19, PIN_D21, PIN_D22, PIN_D23
147147
};
148148
#endif
149149

@@ -450,6 +450,7 @@ void setup()
450450
#endif
451451
}
452452

453+
453454
// You need this timer for non-critical tasks. Avoid abusing ISR if not absolutely necessary.
454455
simpleTimer.setInterval(SIMPLE_TIMER_MS, simpleTimerDoingSomething2s);
455456
}

examples/ISR_16_PWMs_Array_Simple/ISR_16_PWMs_Array_Simple.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ bool IRAM_ATTR TimerHandler(void * timerNo)
103103
#define PIN_D21 21 // Pin D21 mapped to pin GPIO21/SDA of ESP32
104104
#define PIN_D22 22 // Pin D22 mapped to pin GPIO22/SCL of ESP32
105105
#define PIN_D23 23 // Pin D23 mapped to pin GPIO23/VSPI_MOSI of ESP32
106-
#define PIN_D24 24 // Pin D24 mapped to pin GPIO24 of ESP32
107106
#define PIN_D25 25 // Pin D25 mapped to pin GPIO25/ADC18/DAC1 of ESP32
108107
#define PIN_D26 26 // Pin D26 mapped to pin GPIO26/ADC19/DAC2 of ESP32
109108
#define PIN_D27 27 // Pin D27 mapped to pin GPIO27/ADC17/TOUCH7 of ESP32
@@ -131,10 +130,11 @@ uint32_t PWM_Pin[] =
131130
PIN_D9, PIN_D10, PIN_D11, PIN_D12, PIN_D13, PIN_D14, PIN_D15, PIN_D16,
132131
};
133132
#else
133+
// Bad pins to use: PIN_D24
134134
uint32_t PWM_Pin[] =
135135
{
136-
PIN_D24, LED_BUILTIN, PIN_D3, PIN_D4, PIN_D5, PIN_D12, PIN_D13, PIN_D14,
137-
PIN_D15, PIN_D16, PIN_D17, PIN_D18, PIN_D19, PIN_D21, PIN_D22, PIN_D23
136+
LED_BUILTIN, PIN_D25, PIN_D3, PIN_D4, PIN_D5, PIN_D12, PIN_D13, PIN_D14,
137+
PIN_D15, PIN_D16, PIN_D17, PIN_D18, PIN_D19, PIN_D21, PIN_D22, PIN_D23
138138
};
139139
#endif
140140

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ESP32_PWM",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"keywords": "timing, device, control, pwm, 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, synchronized-PWM, on-the-fly",
55
"description": "This library enables you to use Interrupt from Hardware Timers on an ESP32, ESP32_S2, ESP32_S3 or ESP32_C3-based board to create and output PWM to pins. It now supports 16 ISR-based synchronized PWM channels, while consuming only 1 Hardware Timer. PWM interval can be very long (uint32_t millisecs). The most important feature is they're ISR-based PWM channels. Therefore, their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks. These hardware PWM channels, 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. Now you can change the PWM settings on-the-fly",
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_PWM
2-
version=1.3.1
2+
version=1.3.2
33
author=Khoi Hoang <[email protected]>
44
maintainer=Khoi Hoang <[email protected]>
55
sentence=This library enables you to use Interrupt from Hardware Timers on an ESP32, ESP32_S2, ESP32_S3 or ESP32_C3-based board to create and output PWM to pins.

platformio/platformio.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ upload_speed = 921600
2727

2828
; Checks for the compatibility with frameworks and dev/platforms
2929
lib_compat_mode = strict
30+
lib_ldf_mode = chain+
31+
;lib_ldf_mode = deep+
3032

3133
lib_deps =
3234

src/ESP32_PWM.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
Therefore, their executions are not blocked by bad-behaving functions / tasks.
2323
This important feature is absolutely necessary for mission-critical tasks.
2424
25-
Version: 1.3.1
25+
Version: 1.3.2
2626
2727
Version Modified By Date Comments
2828
------- ----------- ---------- -----------
@@ -35,6 +35,7 @@
3535
1.2.2 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period. Optimize code
3636
1.3.0 K Hoang 12/02/2022 Add support to new ESP32-S3
3737
1.3.1 K Hoang 04/03/2022 Fix `DutyCycle` and `New Period` display bugs. Display warning only when debug level > 3
38+
1.3.2 K Hoang 09/05/2022 Remove crashing PIN_D24 from examples
3839
*****************************************************************************************************************************/
3940

4041
#pragma once

0 commit comments

Comments
 (0)