Skip to content

Commit a815a15

Browse files
authored
Merge branch 'master' into feat/espnow-library
2 parents 5fe5f77 + 7bdf67e commit a815a15

File tree

125 files changed

+4240
-3187
lines changed

Some content is hidden

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

125 files changed

+4240
-3187
lines changed

.github/scripts/on-push.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ if [ "$BUILD_PIO" -eq 0 ]; then
7272
FQBN_ESP32H2="espressif:esp32:esp32h2:PartitionScheme=huge_app"
7373

7474
SKETCHES_ESP32="\
75-
$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino\
75+
$ARDUINO_ESP32_PATH/libraries/NetworkClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino\
7676
$ARDUINO_ESP32_PATH/libraries/BLE/examples/Server/Server.ino\
7777
$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino\
7878
$ARDUINO_ESP32_PATH/libraries/Insights/examples/MinimalDiagnostics/MinimalDiagnostics.ino\
@@ -90,7 +90,7 @@ else
9090
BOARD="esp32dev"
9191
OPTIONS="board_build.partitions = huge_app.csv"
9292
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
93-
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
93+
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/NetworkClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
9494
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
9595
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/Server/Server.ino" && \
9696
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"

CMakeLists.txt

+15-7
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ set(ARDUINO_ALL_LIBRARIES
9494
Insights
9595
LittleFS
9696
NetBIOS
97+
Network
9798
Preferences
9899
RainMaker
99100
SD_MMC
@@ -105,7 +106,7 @@ set(ARDUINO_ALL_LIBRARIES
105106
Update
106107
USB
107108
WebServer
108-
WiFiClientSecure
109+
NetworkClientSecure
109110
WiFi
110111
WiFiProv
111112
Wire
@@ -203,20 +204,27 @@ set(ARDUINO_LIBRARY_WebServer_SRCS
203204
libraries/WebServer/src/Parsing.cpp
204205
libraries/WebServer/src/detail/mimetable.cpp)
205206

206-
set(ARDUINO_LIBRARY_WiFiClientSecure_SRCS
207-
libraries/WiFiClientSecure/src/ssl_client.cpp
208-
libraries/WiFiClientSecure/src/WiFiClientSecure.cpp)
207+
set(ARDUINO_LIBRARY_NetworkClientSecure_SRCS
208+
libraries/NetworkClientSecure/src/ssl_client.cpp
209+
libraries/NetworkClientSecure/src/NetworkClientSecure.cpp)
210+
211+
set(ARDUINO_LIBRARY_Network_SRCS
212+
libraries/Network/src/NetworkInterface.cpp
213+
libraries/Network/src/NetworkEvents.cpp
214+
libraries/Network/src/NetworkManager.cpp
215+
libraries/Network/src/NetworkClient.cpp
216+
libraries/Network/src/NetworkServer.cpp
217+
libraries/Network/src/NetworkUdp.cpp)
209218

210219
set(ARDUINO_LIBRARY_WiFi_SRCS
211220
libraries/WiFi/src/WiFiAP.cpp
212-
libraries/WiFi/src/WiFiClient.cpp
213221
libraries/WiFi/src/WiFi.cpp
214222
libraries/WiFi/src/WiFiGeneric.cpp
215223
libraries/WiFi/src/WiFiMulti.cpp
216224
libraries/WiFi/src/WiFiScan.cpp
217-
libraries/WiFi/src/WiFiServer.cpp
218225
libraries/WiFi/src/WiFiSTA.cpp
219-
libraries/WiFi/src/WiFiUdp.cpp)
226+
libraries/WiFi/src/STA.cpp
227+
libraries/WiFi/src/AP.cpp)
220228

221229
set(ARDUINO_LIBRARY_WiFiProv_SRCS libraries/WiFiProv/src/WiFiProv.cpp)
222230

Kconfig.projbuild

+63-82
Original file line numberDiff line numberDiff line change
@@ -256,157 +256,138 @@ config ARDUINO_SELECTIVE_COMPILATION
256256
bool "Include only specific Arduino libraries"
257257
default n
258258

259-
config ARDUINO_SELECTIVE_ArduinoOTA
260-
bool "Enable ArduinoOTA"
261-
depends on ARDUINO_SELECTIVE_COMPILATION
262-
select ARDUINO_SELECTIVE_WiFi
263-
select ARDUINO_SELECTIVE_ESPmDNS
264-
default y
265-
266-
config ARDUINO_SELECTIVE_AsyncUDP
267-
bool "Enable AsyncUDP"
268-
depends on ARDUINO_SELECTIVE_COMPILATION
269-
default y
270-
271-
config ARDUINO_SELECTIVE_AzureIoT
272-
bool "Enable AzureIoT"
273-
depends on ARDUINO_SELECTIVE_COMPILATION
274-
select ARDUINO_SELECTIVE_HTTPClient
275-
default y
276-
277-
config ARDUINO_SELECTIVE_BLE
278-
bool "Enable BLE"
279-
depends on ARDUINO_SELECTIVE_COMPILATION
280-
default y
281-
282-
config ARDUINO_SELECTIVE_BluetoothSerial
283-
bool "Enable BluetoothSerial"
259+
config ARDUINO_SELECTIVE_SPI
260+
bool "Enable SPI"
284261
depends on ARDUINO_SELECTIVE_COMPILATION
285262
default y
286263

287-
config ARDUINO_SELECTIVE_DNSServer
288-
bool "Enable DNSServer"
264+
config ARDUINO_SELECTIVE_Wire
265+
bool "Enable Wire"
289266
depends on ARDUINO_SELECTIVE_COMPILATION
290-
select ARDUINO_SELECTIVE_WiFi
291267
default y
292268

293269
config ARDUINO_SELECTIVE_EEPROM
294270
bool "Enable EEPROM"
295271
depends on ARDUINO_SELECTIVE_COMPILATION
296272
default y
297273

298-
config ARDUINO_SELECTIVE_ESP32
299-
bool "Enable ESP32"
274+
config ARDUINO_SELECTIVE_Preferences
275+
bool "Enable Preferences"
300276
depends on ARDUINO_SELECTIVE_COMPILATION
301277
default y
302278

303-
config ARDUINO_SELECTIVE_ESPmDNS
304-
bool "Enable ESPmDNS"
279+
config ARDUINO_SELECTIVE_Ticker
280+
bool "Enable Ticker"
305281
depends on ARDUINO_SELECTIVE_COMPILATION
306-
select ARDUINO_SELECTIVE_WiFi
307282
default y
308283

309-
config ARDUINO_SELECTIVE_FFat
310-
bool "Enable FFat"
284+
config ARDUINO_SELECTIVE_Update
285+
bool "Enable Update"
311286
depends on ARDUINO_SELECTIVE_COMPILATION
312-
select ARDUINO_SELECTIVE_FS
313287
default y
314288

315289
config ARDUINO_SELECTIVE_FS
316290
bool "Enable FS"
317291
depends on ARDUINO_SELECTIVE_COMPILATION
318292
default y
319293

320-
config ARDUINO_SELECTIVE_HTTPClient
321-
bool "Enable HTTPClient"
322-
depends on ARDUINO_SELECTIVE_COMPILATION
323-
select ARDUINO_SELECTIVE_WiFi
324-
select ARDUINO_SELECTIVE_WiFiClientSecure
294+
config ARDUINO_SELECTIVE_SD
295+
bool "Enable SD"
296+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_FS
325297
default y
326298

327-
config ARDUINO_SELECTIVE_LITTLEFS
328-
bool "Enable LITTLEFS"
329-
depends on ARDUINO_SELECTIVE_COMPILATION
330-
select ARDUINO_SELECTIVE_FS
299+
config ARDUINO_SELECTIVE_SD_MMC
300+
bool "Enable SD_MMC"
301+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_FS
331302
default y
332303

333-
config ARDUINO_SELECTIVE_NetBIOS
334-
bool "Enable NetBIOS"
335-
depends on ARDUINO_SELECTIVE_COMPILATION
336-
select ARDUINO_SELECTIVE_WiFi
304+
config ARDUINO_SELECTIVE_SPIFFS
305+
bool "Enable SPIFFS"
306+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_FS
337307
default y
338308

339-
config ARDUINO_SELECTIVE_Preferences
340-
bool "Enable Preferences"
341-
depends on ARDUINO_SELECTIVE_COMPILATION
309+
config ARDUINO_SELECTIVE_FFat
310+
bool "Enable FFat"
311+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_FS
342312
default y
343313

344-
config ARDUINO_SELECTIVE_SD
345-
bool "Enable SD"
346-
depends on ARDUINO_SELECTIVE_COMPILATION
347-
select ARDUINO_SELECTIVE_FS
314+
config ARDUINO_SELECTIVE_LITTLEFS
315+
bool "Enable LITTLEFS"
316+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_FS
348317
default y
349318

350-
config ARDUINO_SELECTIVE_SD_MMC
351-
bool "Enable SD_MMC"
319+
config ARDUINO_SELECTIVE_Networking
320+
bool "Enable Networking"
352321
depends on ARDUINO_SELECTIVE_COMPILATION
353-
select ARDUINO_SELECTIVE_FS
354322
default y
355323

356-
config ARDUINO_SELECTIVE_SimpleBLE
357-
bool "Enable SimpleBLE"
358-
depends on ARDUINO_SELECTIVE_COMPILATION
324+
config ARDUINO_SELECTIVE_ArduinoOTA
325+
bool "Enable ArduinoOTA"
326+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Networking
327+
select ARDUINO_SELECTIVE_ESPmDNS
359328
default y
360329

361-
config ARDUINO_SELECTIVE_SPI
362-
bool "Enable SPI"
363-
depends on ARDUINO_SELECTIVE_COMPILATION
330+
config ARDUINO_SELECTIVE_AsyncUDP
331+
bool "Enable AsyncUDP"
332+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Networking
364333
default y
365334

366-
config ARDUINO_SELECTIVE_SPIFFS
367-
bool "Enable SPIFFS"
368-
depends on ARDUINO_SELECTIVE_COMPILATION
369-
select ARDUINO_SELECTIVE_FS
335+
config ARDUINO_SELECTIVE_DNSServer
336+
bool "Enable DNSServer"
337+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Networking
370338
default y
371339

372-
config ARDUINO_SELECTIVE_Ticker
373-
bool "Enable Ticker"
374-
depends on ARDUINO_SELECTIVE_COMPILATION
340+
config ARDUINO_SELECTIVE_ESPmDNS
341+
bool "Enable ESPmDNS"
342+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Networking
375343
default y
376344

377-
config ARDUINO_SELECTIVE_Update
378-
bool "Enable Update"
379-
depends on ARDUINO_SELECTIVE_COMPILATION
345+
config ARDUINO_SELECTIVE_HTTPClient
346+
bool "Enable HTTPClient"
347+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Networking
348+
select ARDUINO_SELECTIVE_WiFiClientSecure
349+
default y
350+
351+
config ARDUINO_SELECTIVE_NetBIOS
352+
bool "Enable NetBIOS"
353+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Networking
380354
default y
381355

382356
config ARDUINO_SELECTIVE_WebServer
383357
bool "Enable WebServer"
384-
depends on ARDUINO_SELECTIVE_COMPILATION
358+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Networking
385359
default y
386360
select ARDUINO_SELECTIVE_FS
387361

388362
config ARDUINO_SELECTIVE_WiFi
389363
bool "Enable WiFi"
390-
depends on ARDUINO_SELECTIVE_COMPILATION
364+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Networking
391365
default y
392366

393367
config ARDUINO_SELECTIVE_WiFiClientSecure
394368
bool "Enable WiFiClientSecure"
395-
depends on ARDUINO_SELECTIVE_COMPILATION
396-
select ARDUINO_SELECTIVE_WiFi
369+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Networking
397370
default y
398371

399372
config ARDUINO_SELECTIVE_WiFiProv
400373
bool "Enable WiFiProv"
374+
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Networking && ARDUINO_SELECTIVE_WiFi
375+
default y
376+
377+
config ARDUINO_SELECTIVE_BLE
378+
bool "Enable BLE"
401379
depends on ARDUINO_SELECTIVE_COMPILATION
402-
select ARDUINO_SELECTIVE_WiFi
403380
default y
404381

405-
config ARDUINO_SELECTIVE_Wire
406-
bool "Enable Wire"
382+
config ARDUINO_SELECTIVE_BluetoothSerial
383+
bool "Enable BluetoothSerial"
407384
depends on ARDUINO_SELECTIVE_COMPILATION
408385
default y
409386

387+
config ARDUINO_SELECTIVE_SimpleBLE
388+
bool "Enable SimpleBLE"
389+
depends on ARDUINO_SELECTIVE_COMPILATION
390+
default y
410391

411392
endmenu
412393

cores/esp32/esp32-hal-gpio.c

+11
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,16 @@ extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode)
151151
}
152152
}
153153

154+
#ifdef RGB_BUILTIN
155+
uint8_t RGB_BUILTIN_storage = 0;
156+
#endif
157+
154158
extern void ARDUINO_ISR_ATTR __digitalWrite(uint8_t pin, uint8_t val)
155159
{
156160
#ifdef RGB_BUILTIN
157161
if(pin == RGB_BUILTIN){
158162
//use RMT to set all channels on/off
163+
RGB_BUILTIN_storage=val;
159164
const uint8_t comm_val = val != 0 ? RGB_BRIGHTNESS : 0;
160165
neopixelWrite(RGB_BUILTIN, comm_val, comm_val, comm_val);
161166
return;
@@ -170,6 +175,12 @@ extern void ARDUINO_ISR_ATTR __digitalWrite(uint8_t pin, uint8_t val)
170175

171176
extern int ARDUINO_ISR_ATTR __digitalRead(uint8_t pin)
172177
{
178+
#ifdef RGB_BUILTIN
179+
if(pin == RGB_BUILTIN){
180+
return RGB_BUILTIN_storage;
181+
}
182+
#endif
183+
173184
if(perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) != NULL){
174185
return gpio_get_level((gpio_num_t)pin);
175186
}

docs/en/api/wifi.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ Function to get the IPv6 address.
345345

346346
.. code-block:: arduino
347347
348-
IPAddress softAPIPv6();
348+
IPAddress softAPlinkLocalIPv6();
349349
350350
The function will return the AP IPv6 address in ``IPAddress`` format.
351351

docs/en/guides/core_compatibility.rst

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Compatibility Guide for ESP32 Arduino Core
2+
==========================================
3+
4+
Introduction
5+
------------
6+
7+
Welcome to the compatibility guide for library developers aiming to support multiple versions of the ESP32 Arduino core. This documentation provides essential tips and best practices for ensuring compatibility with 2.x, 3.x and future versions of the ESP32 Arduino core.
8+
9+
Code Adaptations
10+
----------------
11+
12+
To ensure compatibility with both versions of the ESP32 Arduino core, developers should utilize conditional compilation directives in their code. Below is an example of how to conditionally include code based on the ESP32 Arduino core version::
13+
14+
.. code-block:: cpp
15+
16+
#ifdef ESP_ARDUINO_VERSION_MAJOR
17+
#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
18+
// Code for version 3.x
19+
#else
20+
// Code for version 2.x
21+
#endif
22+
#else
23+
// Code for version 1.x
24+
#endif
25+
26+
Version Print
27+
-------------
28+
29+
To easily print the ESP32 Arduino core version at runtime, developers can use the `ESP_ARDUINO_VERSION_STR` macro. Below is an example of how to print the ESP32 Arduino core version::
30+
31+
.. code-block:: cpp
32+
33+
Serial.printf(" ESP32 Arduino core version: %s\n", ESP_ARDUINO_VERSION_STR);
34+
35+
API Differences
36+
---------------
37+
38+
Developers should be aware, that there may be API differences between major versions of the ESP32 Arduino core. For this we created a `Migration guide <https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides.html>`_. to help developers transition from between major versions of the ESP32 Arduino core.
39+
40+
Library Testing
41+
---------------
42+
43+
We have added an External Library Test CI job, which tests external libraries with the latest version of the ESP32 Arduino core to help developers ensure compatibility with the latest version of the ESP32 Arduino core.
44+
If you want to include your library in the External Library Test CI job, please follow the instructions in the `External Libraries Test <https://docs.espressif.com/projects/arduino-esp32/en/latest/esp32/external_libraries_test.html>`_.

libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <WiFi.h>
22
#include <ESPmDNS.h>
3-
#include <WiFiUdp.h>
3+
#include <NetworkUdp.h>
44
#include <ArduinoOTA.h>
55

66
const char* ssid = "..........";

0 commit comments

Comments
 (0)