You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 29, 2023. It is now read-only.
### Releases v1.8.0
1. Fix doubled time for `ESP32_C3`. Check [Error in the value defined by TIMER0_INTERVAL_MS #28](https://github.com/khoih-prog/ESP32_C3_TimerInterrupt/issues/28)
2. Modify examples to avoid using `LED_BUILTIN` / `GPIO2`, `GPIO1` as it can cause crash in some boards, such as `ESP32_C3`
3. Use `allman astyle` and add `utils`
<ahref="https://www.buymeacoffee.com/khoihprog6"title="Donate to my libraries using BuyMeACoffee"><imgsrc="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png"alt="Donate to my libraries using BuyMeACoffee"style="height: 50px!important;width: 181px!important;" ></a>
10
10
<ahref="https://www.buymeacoffee.com/khoihprog6"title="Donate to my libraries using BuyMeACoffee"><imgsrc="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00"style="height: 20px!important;width: 200px!important;" ></a>
@@ -130,7 +132,7 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
130
132
## Prerequisites
131
133
132
134
1.[`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [](https://github.com/arduino/Arduino/releases/latest)
133
-
2.[`ESP32 Core 2.0.4+`](https://github.com/espressif/arduino-esp32) for ESP32-S2-based boards. [](https://github.com/espressif/arduino-esp32/releases/latest/)
135
+
2.[`ESP32 Core 2.0.5+`](https://github.com/espressif/arduino-esp32) for ESP32-S2-based boards. [](https://github.com/espressif/arduino-esp32/releases/latest/)
134
136
3. To use with certain example
135
137
-[`SimpleTimer library`](https://github.com/jfturcot/SimpleTimer) for [ISR_16_Timers_Array](examples/ISR_16_Timers_Array) and [ISR_16_Timers_Array_Complex](examples/ISR_16_Timers_Array_Complex) examples.
136
138
@@ -150,9 +152,9 @@ You can also use this link [ page.
153
-
2. Download the latest release `ESP32_C3_TimerInterrupt-master.zip`.
154
-
3. Extract the zip file to `ESP32_C3_TimerInterrupt-master` directory
155
-
4. Copy whole `ESP32_C3_TimerInterrupt-master` folder to Arduino libraries' directory such as `~/Arduino/libraries/`.
155
+
2. Download the latest release `ESP32_C3_TimerInterrupt-main.zip`.
156
+
3. Extract the zip file to `ESP32_C3_TimerInterrupt-main` directory
157
+
4. Copy whole `ESP32_C3_TimerInterrupt-main` folder to Arduino libraries' directory such as `~/Arduino/libraries/`.
156
158
157
159
### VS Code & PlatformIO
158
160
@@ -175,13 +177,13 @@ In Platform IO, to fix the error when using [`LittleFS_esp32 v1.0`](https://gith
175
177
176
178
from
177
179
178
-
```
180
+
```cpp
179
181
//#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
180
182
```
181
183
182
184
to
183
185
184
-
```
186
+
```cpp
185
187
#defineCONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
186
188
```
187
189
@@ -198,7 +200,7 @@ The current library implementation, using `xyz-Impl.h` instead of standard `xyz.
198
200
199
201
You can include these `.hpp` or `.h` files
200
202
201
-
```
203
+
```cpp
202
204
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
@@ -208,7 +210,7 @@ You can include these `.hpp` or `.h` files
208
210
209
211
in many files. But be sure to use the following `.h` file **in just 1 `.h`, `.cpp` or `.ino` file**, which must **not be included in any other file**, to avoid `Multiple Definitions` Linker Error
210
212
211
-
```
213
+
```cpp
212
214
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
@@ -226,33 +228,33 @@ Please have a look at [**ESP_WiFiManager Issue 39: Not able to read analog port
226
228
227
229
#### 2. ESP32 ADCs functions
228
230
229
-
- ADC1 controls ADC function for pins **GPIO32-GPIO39**
230
-
- ADC2 controls ADC function for pins **GPIO0, 2, 4, 12-15, 25-27**
231
+
-`ADC1` controls ADC function for pins **GPIO32-GPIO39**
232
+
-`ADC2` controls ADC function for pins **GPIO0, 2, 4, 12-15, 25-27**
231
233
232
234
#### 3.. ESP32 WiFi uses ADC2 for WiFi functions
233
235
234
-
Look in file [**adc_common.c**](https://github.com/espressif/esp-idf/blob/master/components/driver/adc_common.c#L61)
236
+
Look in file [**adc_common.c**](https://github.com/espressif/esp-idf/blob/master/components/driver/adc_common.c)
235
237
236
-
> In ADC2, there're two locks used for different cases:
238
+
> In `ADC2`, there're two locks used for different cases:
237
239
> 1. lock shared with app and Wi-Fi:
238
240
> ESP32:
239
-
> When Wi-Fi using the ADC2, we assume it will never stop, so app checks the lock and returns immediately if failed.
241
+
> When Wi-Fi using the `ADC2`, we assume it will never stop, so app checks the lock and returns immediately if failed.
240
242
> ESP32S2:
241
243
> The controller's control over the ADC is determined by the arbiter. There is no need to control by lock.
242
244
>
243
245
> 2. lock shared between tasks:
244
-
> when several tasks sharing the ADC2, we want to guarantee
246
+
> when several tasks sharing the `ADC2`, we want to guarantee
245
247
> all the requests will be handled.
246
248
> Since conversions are short (about 31us), app returns the lock very soon,
247
249
> we use a spinlock to stand there waiting to do conversions one by one.
248
250
>
249
251
> adc2_spinlock should be acquired first, then adc2_wifi_lock or rtc_spinlock.
250
252
251
253
252
-
- In order to use ADC2 for other functions, we have to **acquire complicated firmware locks and very difficult to do**
253
-
- So, it's not advisable to use ADC2 with WiFi/BlueTooth (BT/BLE).
254
-
- Use ADC1, and pins GPIO32-GPIO39
255
-
- If somehow it's a must to use those pins serviced by ADC2 (**GPIO0, 2, 4, 12, 13, 14, 15, 25, 26 and 27**), use the **fix mentioned at the end** of [**ESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example**](https://github.com/khoih-prog/ESP_WiFiManager/issues/39) to work with ESP32 WiFi/BlueTooth (BT/BLE).
254
+
- In order to use `ADC2` for other functions, we have to **acquire complicated firmware locks and very difficult to do**
255
+
- So, it's not advisable to use `ADC2` with WiFi/BlueTooth (BT/BLE).
256
+
- Use `ADC1`, and pins `GPIO32-GPIO39`
257
+
- If somehow it's a must to use those pins serviced by `ADC2` (**GPIO0, 2, 4, 12, 13, 14, 15, 25, 26 and 27**), use the **fix mentioned at the end** of [**ESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example**](https://github.com/khoih-prog/ESP_WiFiManager/issues/39) to work with ESP32 WiFi/BlueTooth (BT/BLE).
256
258
257
259
---
258
260
---
@@ -288,7 +290,7 @@ Before using any Timer, you have to make sure the Timer has not been used by any
288
290
289
291
Using as follows:
290
292
291
-
```
293
+
```cpp
292
294
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
293
295
#include"ESP32_C3_TimerInterrupt.h"
294
296
@@ -345,7 +347,7 @@ void setup()
345
347
346
348
### Example [TimerInterruptTest](examples/TimerInterruptTest)
0 commit comments