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

Commit 808e9a2

Browse files
authored
v1.4.0 to auto detect ESP32 core
#### Releases v1.4.0 ##### Warning: Releases v1.4.0+ can be used and autodetect ESP32 core v2.0.0+ or v1.0.6-. 1. Auto detect ESP32 core 2. Renew examples 3. Display compiler `#warning` only when DEBUG_LEVEL is 3+
1 parent bd03559 commit 808e9a2

33 files changed

+94
-80
lines changed

CONTRIBUTING.md

+3-3
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.16) or Platform.io version
18-
* Board Core Version (e.g. ESP32 core v2.0.0)
18+
* Board Core Version (e.g. ESP32 core v2.0.1)
1919
* Contextual information (e.g. what you were trying to achieve)
2020
* Simplest possible steps to reproduce
2121
* Anything that might be relevant in your opinion, such as:
@@ -28,9 +28,9 @@ Please ensure to specify the following:
2828
```
2929
Arduino IDE version: 1.8.16
3030
WT32_ETH01 board
31-
ESP32 core v2.0.0
31+
ESP32 core v2.0.1
3232
OS: Ubuntu 20.04 LTS
33-
Linux xy-Inspiron-3593 5.4.0-86-generic #97-Ubuntu SMP Fri Sep 17 19:19:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
33+
Linux xy-Inspiron-3593 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3434
3535
Context:
3636
I encountered a crash while trying to use the Timer Interrupt.

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ To use with core v1.0.6-, just define in your sketch
115115
#define USING_CORE_ESP32_CORE_V200_PLUS false
116116
```
117117

118+
- Releases v1.4.0 can be used for either ESP32 core v2.0.0+ or v1.0.6-. **Autodetect core**
119+
118120
---
119121

120122
#### Features
@@ -155,7 +157,7 @@ to apply the better and faster **asynchronous** feature of the **powerful** [ESP
155157
## Prerequisites
156158

157159
1. [`Arduino IDE 1.8.16+` for Arduino](https://www.arduino.cc/en/Main/Software)
158-
2. [`ESP32 Core 2.0.0+`](https://github.com/espressif/arduino-esp32) for ESP32-based WT32_ETH01 boards using release v1.3.0+. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/)
160+
2. [`ESP32 Core 2.0.1+`](https://github.com/espressif/arduino-esp32) for ESP32-based WT32_ETH01 boards using release v1.3.0+. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/)
159161
3. [`ESP32 Core 1.0.6-`](https://github.com/espressif/arduino-esp32) for ESP32-based WT32_ETH01 boards using release v1.2.5- [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/)
160162

161163
4. [`AsyncTCP library v1.1.1+`](https://github.com/me-no-dev/AsyncTCP).
@@ -1350,9 +1352,6 @@ build_flags =
13501352
#error This code is designed for WT32_ETH01 to run on ESP32 platform! Please check your Tools->Board setting.
13511353
#endif
13521354

1353-
// Uncomment to use ESP32 core v1.0.6-
1354-
//#define USING_CORE_ESP32_CORE_V200_PLUS false
1355-
13561355
#include <Arduino.h>
13571356

13581357
#define _ASYNC_WEBSERVER_LOGLEVEL_ 4
@@ -1518,7 +1517,7 @@ Following are debug terminal output and screen shots when running example [Async
15181517
15191518
```
15201519
Starting AsyncMultiWebServer_WT32_ETH01 on WT32-ETH01 with ETH_PHY_LAN8720
1521-
AsyncWebServer_WT32_ETH01 v1.3.0 for core v2.0.0+
1520+
AsyncWebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
15221521
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232
15231522
FULL_DUPLEX, 100Mbps
15241523

@@ -1588,6 +1587,8 @@ Submit issues to: [AsyncWebServer_WT32_ETH01 issues](https://github.com/khoih-pr
15881587
3. Add debugging features.
15891588
4. Add Table-of-Contents and Version String
15901589
5. Support breaking ESP32 core v2.0.0+ as well as v1.0.6-
1590+
6. Auto detect ESP32 core v1.0.6- or v2.0.0+ to use correct settings
1591+
7. Display compiler `#warning` only when DEBUG_LEVEL is 3+
15911592

15921593

15931594
---

changelog.md

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
## Table of contents
1212

1313
* [Changelog](#changelog)
14+
* [Releases v1.4.0](#releases-v140)
1415
* [Releases v1.3.0](#releases-v130)
1516
* [Releases v1.2.5](#releases-v125)
1617
* [Releases v1.2.4](#releases-v124)
@@ -22,6 +23,14 @@
2223

2324
## Changelog
2425

26+
#### Releases v1.4.0
27+
28+
##### Warning: Releases v1.4.0+ can be used and autodetect ESP32 core v2.0.0+ or v1.0.6-.
29+
30+
1. Auto detect ESP32 core
31+
2. Renew examples
32+
3. Display compiler `#warning` only when DEBUG_LEVEL is 3+
33+
2534
#### Releases v1.3.0
2635

2736
##### Warning: Releases v1.3.0+ can be used for either ESP32 core v2.0.0+ or v1.0.6-. Default is v2.0.0+ now

examples/AsyncFSBrowser_WT32_ETH01/AsyncFSBrowser_WT32_ETH01.ino

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@
2121

2222
#endif
2323

24-
// Uncomment to use ESP32 core v1.0.6-
25-
//#define USING_CORE_ESP32_CORE_V200_PLUS false
26-
2724
#include <Arduino.h>
2825

29-
#define _ASYNC_WEBSERVER_LOGLEVEL_ 4
26+
#define _ASYNC_WEBSERVER_LOGLEVEL_ 2
3027

3128
// Select the IP address according to your local network
3229
IPAddress myIP(192, 168, 2, 232);

examples/AsyncMultiWebServer_WT32_ETH01/AsyncMultiWebServer_WT32_ETH01.ino

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
#error This code is designed for WT32_ETH01 to run on ESP32 platform! Please check your Tools->Board setting.
1515
#endif
1616

17-
// Uncomment to use ESP32 core v1.0.6-
18-
//#define USING_CORE_ESP32_CORE_V200_PLUS false
19-
2017
#include <Arduino.h>
2118

22-
#define _ASYNC_WEBSERVER_LOGLEVEL_ 4
19+
#define _ASYNC_WEBSERVER_LOGLEVEL_ 2
2320

2421
// Select the IP address according to your local network
2522
IPAddress myIP(192, 168, 2, 232);

examples/AsyncSimpleServer_WT32_ETH01/AsyncSimpleServer_WT32_ETH01.ino

+1-4
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,9 @@
2727
#error This code is designed for WT32_ETH01 to run on ESP32 platform! Please check your Tools->Board setting.
2828
#endif
2929

30-
// Uncomment to use ESP32 core v1.0.6-
31-
//#define USING_CORE_ESP32_CORE_V200_PLUS false
32-
3330
#include <Arduino.h>
3431

35-
#define _ASYNC_WEBSERVER_LOGLEVEL_ 4
32+
#define _ASYNC_WEBSERVER_LOGLEVEL_ 2
3633

3734
// Select the IP address according to your local network
3835
IPAddress myIP(192, 168, 2, 232);

examples/Async_AdvancedWebServer/Async_AdvancedWebServer.ino

+1-4
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,9 @@
4242
#error This code is designed for WT32_ETH01 to run on ESP32 platform! Please check your Tools->Board setting.
4343
#endif
4444

45-
// Uncomment to use ESP32 core v1.0.6-
46-
//#define USING_CORE_ESP32_CORE_V200_PLUS false
47-
4845
#include <Arduino.h>
4946

50-
#define _ASYNC_WEBSERVER_LOGLEVEL_ 4
47+
#define _ASYNC_WEBSERVER_LOGLEVEL_ 2
5148

5249
// Select the IP address according to your local network
5350
IPAddress myIP(192, 168, 2, 232);

examples/Async_HelloServer/Async_HelloServer.ino

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
#error This code is designed for WT32_ETH01 to run on ESP32 platform! Please check your Tools->Board setting.
1515
#endif
1616

17-
// Uncomment to use ESP32 core v1.0.6-
18-
//#define USING_CORE_ESP32_CORE_V200_PLUS false
19-
2017
#include <Arduino.h>
2118

22-
#define _ASYNC_WEBSERVER_LOGLEVEL_ 4
19+
#define _ASYNC_WEBSERVER_LOGLEVEL_ 2
2320

2421
// Select the IP address according to your local network
2522
IPAddress myIP(192, 168, 2, 232);

examples/Async_HelloServer2/Async_HelloServer2.ino

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
#error This code is designed for WT32_ETH01 to run on ESP32 platform! Please check your Tools->Board setting.
1515
#endif
1616

17-
// Uncomment to use ESP32 core v1.0.6-
18-
//#define USING_CORE_ESP32_CORE_V200_PLUS false
19-
2017
#include <Arduino.h>
2118

22-
#define _ASYNC_WEBSERVER_LOGLEVEL_ 4
19+
#define _ASYNC_WEBSERVER_LOGLEVEL_ 2
2320

2421
// Select the IP address according to your local network
2522
IPAddress myIP(192, 168, 2, 232);

examples/Async_PostServer/Async_PostServer.ino

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
#error This code is designed for WT32_ETH01 to run on ESP32 platform! Please check your Tools->Board setting.
1515
#endif
1616

17-
// Uncomment to use ESP32 core v1.0.6-
18-
//#define USING_CORE_ESP32_CORE_V200_PLUS false
19-
2017
#include <Arduino.h>
2118

22-
#define _ASYNC_WEBSERVER_LOGLEVEL_ 4
19+
#define _ASYNC_WEBSERVER_LOGLEVEL_ 2
2320

2421
// Select the IP address according to your local network
2522
IPAddress myIP(192, 168, 2, 232);

examples/Async_RegexPatterns_WT32_ETH01/Async_RegexPatterns_WT32_ETH01.ino

+1-4
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,9 @@
3333
#error This code is designed for WT32_ETH01 to run on ESP32 platform! Please check your Tools->Board setting.
3434
#endif
3535

36-
// Uncomment to use ESP32 core v1.0.6-
37-
//#define USING_CORE_ESP32_CORE_V200_PLUS false
38-
3936
#include <Arduino.h>
4037

41-
#define _ASYNC_WEBSERVER_LOGLEVEL_ 4
38+
#define _ASYNC_WEBSERVER_LOGLEVEL_ 2
4239

4340
// Select the IP address according to your local network
4441
IPAddress myIP(192, 168, 2, 232);

library.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"AsyncWebServer_WT32_ETH01",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"description":"Asynchronous HTTP and WebSocket Server Library for WT32_ETH01 (ESP32 + LAN8720)",
55
"keywords":"http, async, async-webserver, websocket, webserver, esp32, wt32-eth01, lan8720, lan8720a",
66
"authors":
@@ -33,5 +33,6 @@
3333
}
3434
],
3535
"platforms": ["espressif32"],
36-
"examples": "examples/*/*/*.ino"
36+
"examples": "examples/*/*/*.ino",
37+
"headers": "AsyncWebServer_WT32_ETH01.h"
3738
}

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=AsyncWebServer_WT32_ETH01
2-
version=1.3.0
2+
version=1.4.0
33
author=Hristo Gochkov,Khoi Hoang
44
maintainer=Khoi Hoang <[email protected]>
55
license=GPLv3

src/AsyncEventSource.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@
2222
You should have received a copy of the GNU Lesser General Public License along with this library;
2323
if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2424
25-
Version: 1.3.0
25+
Version: 1.4.0
2626
2727
Version Modified By Date Comments
2828
------- ----------- ---------- -----------
2929
1.2.3 K Hoang 17/07/2021 Initial porting for WT32_ETH01 (ESP32 + LAN8720). Sync with ESPAsyncWebServer v1.2.3
3030
1.2.4 K Hoang 02/08/2021 Fix Mbed TLS compile error with ESP32 core v2.0.0-rc1+
3131
1.2.5 K Hoang 09/10/2021 Update `platform.ini` and `library.json`Working only with core v1.0.6-
3232
1.3.0 K Hoang 23/10/2021 Making compatible with breaking core v2.0.0+
33+
1.4.0 K Hoang 27/11/2021 Auto detect ESP32 core version
3334
*****************************************************************************************************************************/
3435

3536
#include "Arduino.h"

src/AsyncEventSource.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@
2222
You should have received a copy of the GNU Lesser General Public License along with this library;
2323
if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2424
25-
Version: 1.3.0
25+
Version: 1.4.0
2626
2727
Version Modified By Date Comments
2828
------- ----------- ---------- -----------
2929
1.2.3 K Hoang 17/07/2021 Initial porting for WT32_ETH01 (ESP32 + LAN8720). Sync with ESPAsyncWebServer v1.2.3
3030
1.2.4 K Hoang 02/08/2021 Fix Mbed TLS compile error with ESP32 core v2.0.0-rc1+
3131
1.2.5 K Hoang 09/10/2021 Update `platform.ini` and `library.json`Working only with core v1.0.6-
3232
1.3.0 K Hoang 23/10/2021 Making compatible with breaking core v2.0.0+
33+
1.4.0 K Hoang 27/11/2021 Auto detect ESP32 core version
3334
*****************************************************************************************************************************/
3435

3536
#ifndef ASYNCEVENTSOURCE_H_

src/AsyncJson.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@
2222
You should have received a copy of the GNU Lesser General Public License along with this library;
2323
if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2424
25-
Version: 1.3.0
25+
Version: 1.4.0
2626
2727
Version Modified By Date Comments
2828
------- ----------- ---------- -----------
2929
1.2.3 K Hoang 17/07/2021 Initial porting for WT32_ETH01 (ESP32 + LAN8720). Sync with ESPAsyncWebServer v1.2.3
3030
1.2.4 K Hoang 02/08/2021 Fix Mbed TLS compile error with ESP32 core v2.0.0-rc1+
3131
1.2.5 K Hoang 09/10/2021 Update `platform.ini` and `library.json`Working only with core v1.0.6-
3232
1.3.0 K Hoang 23/10/2021 Making compatible with breaking core v2.0.0+
33+
1.4.0 K Hoang 27/11/2021 Auto detect ESP32 core version
3334
*****************************************************************************************************************************/
3435
/*
3536
Async Response to use with ArduinoJson and AsyncWebServer

src/AsyncWebServer_WT32_ETH01.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@
2222
You should have received a copy of the GNU Lesser General Public License along with this library;
2323
if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2424
25-
Version: 1.3.0
25+
Version: 1.4.0
2626
2727
Version Modified By Date Comments
2828
------- ----------- ---------- -----------
2929
1.2.3 K Hoang 17/07/2021 Initial porting for WT32_ETH01 (ESP32 + LAN8720). Sync with ESPAsyncWebServer v1.2.3
3030
1.2.4 K Hoang 02/08/2021 Fix Mbed TLS compile error with ESP32 core v2.0.0-rc1+
3131
1.2.5 K Hoang 09/10/2021 Update `platform.ini` and `library.json`Working only with core v1.0.6-
3232
1.3.0 K Hoang 23/10/2021 Making compatible with breaking core v2.0.0+
33+
1.4.0 K Hoang 27/11/2021 Auto detect ESP32 core version
3334
*****************************************************************************************************************************/
3435

3536
#include "AsyncWebServer_WT32_ETH01.h"
@@ -56,7 +57,7 @@ void WT32_ETH01_event(WiFiEvent_t event)
5657
{
5758
switch (event)
5859
{
59-
#if USING_CORE_ESP32_CORE_V200_PLUS
60+
#if ( ( defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 2) ) && ( ARDUINO_ESP32_GIT_VER != 0x46d5afb1 ) )
6061
// For breaking core v2.0.0
6162
// Why so strange to define a breaking enum arduino_event_id_t in WiFiGeneric.h
6263
// compared to the old system_event_id_t, now in tools/sdk/esp32/include/esp_event/include/esp_event_legacy.h

src/AsyncWebServer_WT32_ETH01.h

+25-17
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,50 @@
2222
You should have received a copy of the GNU Lesser General Public License along with this library;
2323
if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2424
25-
Version: 1.3.0
25+
Version: 1.4.0
2626
2727
Version Modified By Date Comments
2828
------- ----------- ---------- -----------
2929
1.2.3 K Hoang 17/07/2021 Initial porting for WT32_ETH01 (ESP32 + LAN8720). Sync with ESPAsyncWebServer v1.2.3
3030
1.2.4 K Hoang 02/08/2021 Fix Mbed TLS compile error with ESP32 core v2.0.0-rc1+
3131
1.2.5 K Hoang 09/10/2021 Update `platform.ini` and `library.json`Working only with core v1.0.6-
3232
1.3.0 K Hoang 23/10/2021 Making compatible with breaking core v2.0.0+
33+
1.4.0 K Hoang 27/11/2021 Auto detect ESP32 core version
3334
*****************************************************************************************************************************/
3435

3536
#ifndef _AsyncWebServer_WT32_ETH01_H_
3637
#define _AsyncWebServer_WT32_ETH01_H_
3738

38-
#if !defined(USING_CORE_ESP32_CORE_V200_PLUS)
39-
#define USING_CORE_ESP32_CORE_V200_PLUS true
40-
#warning Using code for ESP32 core v2.0.0+
41-
#define ASYNC_WEBSERVER_WT32_ETH01_VERSION "AsyncWebServer_WT32_ETH01 v1.3.0 for core v2.0.0+"
42-
#else
43-
#warning Using code for ESP32 core v1.0.6-
44-
#define ASYNC_WEBSERVER_WT32_ETH01_VERSION "AsyncWebServer_WT32_ETH01 v1.3.0 for core v1.0.6-"
45-
#endif
46-
4739
#if ESP32
48-
#warning Using ESP32 architecture for WebServer_WT32_ETH01
49-
#define BOARD_NAME "WT32-ETH01"
50-
#else
51-
#error This code is designed to run on ESP32 platform! Please check your Tools->Board setting.
52-
#endif
5340

54-
#if ESP32
55-
#warning Using ESP32 architecture for WebServer_WT32_ETH01
41+
#if (_ASYNC_WEBSERVER_LOGLEVEL_ > 2 )
42+
#warning Using ESP32 architecture for WebServer_WT32_ETH01
43+
#endif
44+
5645
#define BOARD_NAME "WT32-ETH01"
5746
#else
5847
#error This code is designed for WT32_ETH01 to run on ESP32 platform! Please check your Tools->Board setting.
5948
#endif
6049

50+
#if ( ( defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 2) ) && ( ARDUINO_ESP32_GIT_VER != 0x46d5afb1 ) )
51+
#define USING_CORE_ESP32_CORE_V200_PLUS true
52+
53+
#if (_ASYNC_WEBSERVER_LOGLEVEL_ > 2 )
54+
#warning Using code for ESP32 core v2.0.0+ in AsyncWebServer_WT32_ETH01.h
55+
#endif
56+
57+
#define ASYNC_WEBSERVER_WT32_ETH01_VERSION "AsyncWebServer_WT32_ETH01 v1.4.0 for core v2.0.0+"
58+
#else
59+
60+
#if (_ASYNC_WEBSERVER_LOGLEVEL_ > 2 )
61+
#warning Using code for ESP32 core v1.0.6- in AsyncWebServer_WT32_ETH01.h
62+
#endif
63+
64+
#define ASYNC_WEBSERVER_WT32_ETH01_VERSION "AsyncWebServer_WT32_ETH01 v1.4.0 for core v1.0.6-"
65+
#endif
66+
67+
68+
6169
#include "Arduino.h"
6270

6371
#include <functional>

src/AsyncWebServer_WT32_ETH01_Debug.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@
2222
You should have received a copy of the GNU Lesser General Public License along with this library;
2323
if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2424
25-
Version: 1.3.0
25+
Version: 1.4.0
2626
2727
Version Modified By Date Comments
2828
------- ----------- ---------- -----------
2929
1.2.3 K Hoang 17/07/2021 Initial porting for WT32_ETH01 (ESP32 + LAN8720). Sync with ESPAsyncWebServer v1.2.3
3030
1.2.4 K Hoang 02/08/2021 Fix Mbed TLS compile error with ESP32 core v2.0.0-rc1+
3131
1.2.5 K Hoang 09/10/2021 Update `platform.ini` and `library.json`Working only with core v1.0.6-
3232
1.3.0 K Hoang 23/10/2021 Making compatible with breaking core v2.0.0+
33+
1.4.0 K Hoang 27/11/2021 Auto detect ESP32 core version
3334
*****************************************************************************************************************************/
3435

3536
#pragma once

0 commit comments

Comments
 (0)