Skip to content

Commit 3d8014b

Browse files
committed
Merge branch 'master' into release/v3.1.x
2 parents 9660e66 + 19e4d0d commit 3d8014b

File tree

36 files changed

+629
-559
lines changed

36 files changed

+629
-559
lines changed

Diff for: .github/ISSUE_TEMPLATE/Issue-report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ body:
7575
attributes:
7676
label: IDE Name
7777
description: What IDE are you using?
78-
placeholder: eg. Arduino IDE, PlatformIO, Sloeber...
78+
placeholder: eg. Arduino IDE, VSCode, Sloeber...
7979
validations:
8080
required: true
8181
- type: input

Diff for: boards.txt

+454
Large diffs are not rendered by default.

Diff for: cores/esp32/Esp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ const char *EspClass::getChipModel(void) {
277277
return "ESP32-D0WD";
278278
}
279279
case EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5: return "ESP32-D2WD";
280-
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2: return "ESP32-PICO-D2";
280+
case EFUSE_RD_CHIP_VER_PKG_ESP32U4WDH: return "ESP32-U4WDH";
281281
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4: return "ESP32-PICO-D4";
282282
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302: return "ESP32-PICO-V3-02";
283283
case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDR2V3: return "ESP32-D0WDR2-V3";

Diff for: docs/_static/logo_pio.png

-25.4 KB
Binary file not shown.

Diff for: docs/en/getting_started.rst

+5-6
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,13 @@ Supported IDEs
7878

7979
Here is the list of supported IDE for Arduino ESP32 support integration.
8080

81-
+-------------------+-------------------+
82-
| |arduino-logo| | |pio-logo| |
83-
+-------------------+-------------------+
84-
| Arduino IDE | PlatformIO |
85-
+-------------------+-------------------+
81+
+-------------------+
82+
| |arduino-logo| |
83+
+-------------------+
84+
| Arduino IDE |
85+
+-------------------+
8686

8787
.. |arduino-logo| image:: ../_static/logo_arduino.png
88-
.. |pio-logo| image:: ../_static/logo_pio.png
8988

9089
See `Installing Guides <installing.html>`_ for more details on how to install the Arduino ESP32 support.
9190

Diff for: docs/en/installing.rst

-87
Original file line numberDiff line numberDiff line change
@@ -63,92 +63,6 @@ To start the installation process using the Boards Manager, follow these steps:
6363

6464
- Restart Arduino IDE.
6565

66-
Installing using PlatformIO
67-
---------------------------
68-
69-
.. figure:: ../_static/logo_pio.png
70-
:align: center
71-
:width: 200
72-
:figclass: align-center
73-
74-
PlatformIO is a professional collaborative platform for embedded development. It has out-of-the-box support for ESP32 SoCs and allows working with Arduino ESP32 as well as ESP-IDF from Espressif without changing your development environment. PlatformIO includes lots of instruments for the most common development tasks such as debugging, unit testing, and static code analysis.
75-
76-
.. warning:: Integration of the Arduino Core ESP32 project in PlatformIO is maintained by PlatformIO developers. Arduino Core ESP32 Project Team cannot support PlatformIO-specific issues. Please report these issues in official `PlatformIO repositories <https://github.com/platformio>`_.
77-
78-
A detailed overview of the PlatformIO ecosystem and its philosophy can be found in `the official documentation <https://docs.platformio.org/en/latest/core/index.html>`_.
79-
80-
PlatformIO can be used in two flavors:
81-
82-
- `PlatformIO IDE <https://platformio.org/platformio-ide>`_ is a toolset for embedded C/C++ development available on Windows, macOS and Linux platforms
83-
84-
- `PlatformIO Core (CLI) <https://docs.platformio.org/en/latest/core/index.html>`_ is a command-line tool that consists of a multi-platform build system, platform and library managers and other integration components. It can be used with a variety of code development environments and allows integration with cloud platforms and web services
85-
86-
To install PlatformIO, you can follow this Getting Started, provided at `docs.platformio.org`_.
87-
88-
Using the stable code
89-
*********************
90-
91-
.. note::
92-
A detailed overview of supported development boards, examples and frameworks can be found on `the official Espressif32 dev-platform page <https://registry.platformio.org/platforms/platformio/espressif32>`_ in the PlatformIO Registry.
93-
94-
The most reliable and easiest way to get started is to use the latest stable version of the ESP32 development platform that passed all tests/verifications and can be used in production.
95-
96-
Create a new project and select one of the available boards. You can change after by changing the `platformio.ini <https://docs.platformio.org/en/latest/projectconf/index.html>`_ file.
97-
98-
- For ESP32
99-
100-
.. code-block:: bash
101-
102-
[env:esp32dev]
103-
platform = espressif32
104-
board = esp32dev
105-
framework = arduino
106-
107-
- For ESP32-S2 (ESP32-S2-Saola-1 board)
108-
109-
.. code-block:: bash
110-
111-
[env:esp32-s2-saola-1]
112-
platform = espressif32
113-
board = esp32-s2-saola-1
114-
framework = arduino
115-
116-
- For ESP32-C3 (ESP32-C3-DevKitM-1 board)
117-
118-
.. code-block:: bash
119-
120-
[env:esp32-c3-devkitm-1]
121-
platform = espressif32
122-
board = esp32-c3-devkitm-1
123-
framework = arduino
124-
125-
How to update to the latest code
126-
********************************
127-
128-
To test the latest Arduino ESP32, you need to change your project *platformio.ini* accordingly.
129-
The following configuration uses the upstream version of the Espressif development platform and the latest Arduino core directly from the Espressif GitHub repository:
130-
131-
.. code-block:: bash
132-
133-
[env:esp32-c3-devkitm-1]
134-
platform = https://github.com/platformio/platform-espressif32.git
135-
board = esp32-c3-devkitm-1
136-
framework = arduino
137-
platform_packages =
138-
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#master
139-
140-
141-
To get more information about PlatformIO, see the following links:
142-
143-
- `PlatformIO Core (CLI) <https://docs.platformio.org/en/latest/core/index.html>`_
144-
145-
- `PlatformIO Home <https://docs.platformio.org/en/latest/home/index.html>`_
146-
147-
- `Tutorials and Examples <https://docs.platformio.org/en/latest/tutorials/index.html>`_
148-
149-
- `Library Management <https://docs.platformio.org/en/latest/librarymanager/index.html>`_
150-
151-
15266
Windows (manual installation)
15367
-----------------------------
15468

@@ -360,4 +274,3 @@ Where ``~/Documents/Arduino`` represents your sketch book location as per "Ardui
360274
- Restart Arduino IDE.
361275

362276
.. _Arduino.cc: https://www.arduino.cc/en/Main/Software
363-
.. _docs.platformio.org: https://docs.platformio.org/en/latest/integration/ide/pioide.html

Diff for: docs/en/tutorials/blink.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Introduction
77

88
This is the interactive blink tutorial using `Wokwi`_. For this tutorial, you don't need the ESP32 board or the Arduino toolchain.
99

10-
.. note:: If you don't want to use this tutorial with the simulation, you can copy and paste the :ref:`blink_example_code` from `Wokwi`_ editor and use it on the `Arduino IDE`_ or `PlatformIO`_.
10+
.. note:: If you don't want to use this tutorial with the simulation, you can copy and paste the :ref:`blink_example_code` from `Wokwi`_ editor and use it on the `Arduino IDE`.
1111

1212
About this Tutorial
1313
-------------------
@@ -109,5 +109,4 @@ Resources
109109

110110
.. _ESP32 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf
111111
.. _Wokwi: https://wokwi.com/
112-
.. _PlatformIO: https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#platformio
113112
.. _Arduino IDE: https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#installing-using-boards-manager

Diff for: libraries/BLE/src/BLECharacteristic.cpp

+25
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,13 @@ void BLECharacteristic::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_ga
279279

280280
log_d(" - Response to write event: New value: handle: %.2x, uuid: %s", getHandle(), getUUID().toString().c_str());
281281

282+
// The call to BLEUtils::buildHexData() doesn't output anything if the log level is not
283+
// "DEBUG". As it is quite CPU intensive, it is much better to not call it if not needed.
284+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
282285
char *pHexData = BLEUtils::buildHexData(nullptr, param->write.value, param->write.len);
283286
log_d(" - Data: length: %d, data: %s", param->write.len, pHexData);
284287
free(pHexData);
288+
#endif
285289

286290
if (param->write.need_rsp) {
287291
esp_gatt_rsp_t rsp;
@@ -390,9 +394,13 @@ void BLECharacteristic::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_ga
390394
rsp.attr_value.handle = param->read.handle;
391395
rsp.attr_value.auth_req = ESP_GATT_AUTH_REQ_NONE;
392396

397+
// The call to BLEUtils::buildHexData() doesn't output anything if the log level is not
398+
// "DEBUG". As it is quite CPU intensive, it is much better to not call it if not needed.
399+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
393400
char *pHexData = BLEUtils::buildHexData(nullptr, rsp.attr_value.value, rsp.attr_value.len);
394401
log_d(" - Data: length=%d, data=%s, offset=%d", rsp.attr_value.len, pHexData, rsp.attr_value.offset);
395402
free(pHexData);
403+
#endif
396404

397405
esp_err_t errRc = ::esp_ble_gatts_send_response(gatts_if, param->read.conn_id, param->read.trans_id, ESP_GATT_OK, &rsp);
398406
if (errRc != ESP_OK) {
@@ -471,7 +479,20 @@ void BLECharacteristic::notify(bool is_notification) {
471479

472480
m_pCallbacks->onNotify(this); // Invoke the notify callback.
473481

482+
// GeneralUtils::hexDump() doesn't output anything if the log level is not
483+
// "VERBOSE". Additionally, it is very CPU intensive, even when it doesn't
484+
// output anything! So it is much better to *not* call it at all if not needed.
485+
// In a simple program which calls BLECharacteristic::notify() every 50 ms,
486+
// the performance gain of this little optimization is 37% in release mode
487+
// (-O3) and 57% in debug mode.
488+
// Of course, the "#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE" guard
489+
// could also be put inside the GeneralUtils::hexDump() function itself. But
490+
// it's better to put it here also, as it is clearer (indicating a verbose log
491+
// thing) and it allows to remove the "m_value.getValue().c_str()" call, which
492+
// is, in itself, quite CPU intensive.
493+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
474494
GeneralUtils::hexDump((uint8_t *)m_value.getValue().c_str(), m_value.getValue().length());
495+
#endif
475496

476497
if (getService()->getServer()->getConnectedCount() == 0) {
477498
log_v("<< notify: No connected clients.");
@@ -624,9 +645,13 @@ void BLECharacteristic::setReadProperty(bool value) {
624645
* @param [in] length The length of the data in bytes.
625646
*/
626647
void BLECharacteristic::setValue(uint8_t *data, size_t length) {
648+
// The call to BLEUtils::buildHexData() doesn't output anything if the log level is not
649+
// "VERBOSE". As it is quite CPU intensive, it is much better to not call it if not needed.
650+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
627651
char *pHex = BLEUtils::buildHexData(nullptr, data, length);
628652
log_v(">> setValue: length=%d, data=%s, characteristic UUID=%s", length, pHex, getUUID().toString().c_str());
629653
free(pHex);
654+
#endif
630655
if (length > ESP_GATT_MAX_ATTR_LEN) {
631656
log_e("Size %d too large, must be no bigger than %d", length, ESP_GATT_MAX_ATTR_LEN);
632657
return;

Diff for: libraries/ESP32/examples/FreeRTOS/BasicMultiThreading/README.md

-4
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ To get more information about the Espressif boards see [Espressif Development Ki
6262
* Before Compile/Verify, select the correct board: `Tools -> Board`.
6363
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.
6464

65-
#### Using Platform IO
66-
67-
* Select the COM port: `Devices` or set the `upload_port` option on the `platformio.ini` file.
68-
6965
## Troubleshooting
7066

7167
***Important: Make sure you are using a good quality USB cable and that you have a reliable power source***

Diff for: libraries/ESP32/examples/FreeRTOS/Mutex/README.md

-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ To get more information about the Espressif boards see [Espressif Development Ki
5151
* Before Compile/Verify, select the correct board: `Tools -> Board`.
5252
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.
5353

54-
#### Using Platform IO
55-
56-
* Select the COM port: `Devices` or set the `upload_port` option on the `platformio.ini` file.
57-
5854
## Example Log Output
5955

6056
The expected output of shared variables protected by mutex demonstrates mutually exclusive access from tasks - they do not interrupt each other and do not rewrite the value before the other task has read it back.

Diff for: libraries/ESP32/examples/FreeRTOS/Queue/README.md

-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ To get more information about the Espressif boards see [Espressif Development Ki
2929
* Before Compile/Verify, select the correct board: `Tools -> Board`.
3030
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.
3131

32-
#### Using Platform IO
33-
34-
* Select the COM port: `Devices` or set the `upload_port` option on the `platformio.ini` file.
35-
3632
## Example Log Output
3733

3834
```

Diff for: libraries/ESP32/examples/FreeRTOS/Semaphore/README.md

-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ To get more information about the Espressif boards see [Espressif Development Ki
3535
* Before Compile/Verify, select the correct board: `Tools -> Board`.
3636
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.
3737

38-
#### Using Platform IO
39-
40-
* Select the COM port: `Devices` or set the `upload_port` option on the `platformio.ini` file.
41-
4238
## Example Log Output
4339

4440
```

Diff for: libraries/ESP32/examples/RMT/Legacy_RMT_Driver_Compatible/Legacy_RMT_Driver_Compatible.ino

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// add the file "build_opt.h" to your Arduino project folder with "-DESP32_ARDUINO_NO_RGB_BUILTIN" to use the RMT Legacy driver
1313
#error "ESP32_ARDUINO_NO_RGB_BUILTIN is not defined, this example is intended to demonstrate the RMT Legacy driver."
1414
#error "Please add the file 'build_opt.h' with '-DESP32_ARDUINO_NO_RGB_BUILTIN' to your Arduino project folder."
15-
#error "Another way to disable the RGB_BUILTIN is to define it in the platformio.ini file, for instance: '-D ESP32_ARDUINO_NO_RGB_BUILTIN'"
1615

1716
#else
1817

Diff for: libraries/ESP32/examples/Template/ExampleTemplate/README.md

-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ To get more information about the Espressif boards see [Espressif Development Ki
6464
* Before Compile/Verify, select the correct board: `Tools -> Board`.
6565
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.
6666

67-
#### Using Platform IO
68-
69-
* Select the COM port: `Devices` or set the `upload_port` option on the `platformio.ini` file.
70-
7167
## Example/Log Output ==(OPTIONAL)==
7268

7369
==*Add the log/serial output here!*==

Diff for: libraries/LittleFS/examples/LITTLEFS_PlatformIO/.gitignore

-4
This file was deleted.

Diff for: libraries/LittleFS/examples/LITTLEFS_PlatformIO/README.md

-68
This file was deleted.

Diff for: libraries/LittleFS/examples/LITTLEFS_PlatformIO/data/file1.txt

-1
This file was deleted.

Diff for: libraries/LittleFS/examples/LITTLEFS_PlatformIO/data/testfolder/test2.txt

-1
This file was deleted.

Diff for: libraries/LittleFS/examples/LITTLEFS_PlatformIO/include/.placeholder.txt

Whitespace-only changes.

Diff for: libraries/LittleFS/examples/LITTLEFS_PlatformIO/lib/.placeholder.txt

Whitespace-only changes.

Diff for: libraries/LittleFS/examples/LITTLEFS_PlatformIO/partitions_custom.csv

-6
This file was deleted.

Diff for: libraries/LittleFS/examples/LITTLEFS_PlatformIO/platformio.ini

-22
This file was deleted.

0 commit comments

Comments
 (0)