Skip to content

Commit 07046f8

Browse files
authored
Merge branch 'master' into power-management
2 parents 9b93762 + 49d9b06 commit 07046f8

File tree

70 files changed

+1508
-113
lines changed

Some content is hidden

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

70 files changed

+1508
-113
lines changed

.github/ISSUE_TEMPLATE/Issue-report.yml

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ body:
4141
options:
4242
- latest master (checkout manually)
4343
- latest development Release Candidate (RC-X)
44+
- v3.0.4
4445
- v3.0.3
4546
- v3.0.2
4647
- v3.0.1

.github/scripts/on-release.sh

+48-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,54 @@ if [ "$RELEASE_PRE" == "false" ]; then
421421
fi
422422
fi
423423

424-
# Upload package JSONs (temporary halted to fix json generation)
424+
# Test the package JSONs
425+
426+
echo "Installing arduino-cli ..."
427+
export PATH="/home/runner/bin:$PATH"
428+
source ./.github/scripts/install-arduino-cli.sh
429+
430+
echo "Testing $PACKAGE_JSON_DEV install ..."
431+
echo "Updating index ..."
432+
arduino-cli core update-index --additional-urls "file://$OUTPUT_DIR/$PACKAGE_JSON_DEV"
433+
if [ $? -ne 0 ]; then echo "ERROR: Failed to update index ($?)"; exit 1; fi
434+
435+
echo "Installing esp32 ..."
436+
arduino-cli core install esp32:esp32
437+
if [ $? -ne 0 ]; then echo "ERROR: Failed to install esp32 ($?)"; exit 1; fi
438+
439+
echo "Compiling example ..."
440+
arduino-cli compile --fqbn esp32:esp32:esp32 $GITHUB_WORKSPACE/libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino
441+
if [ $? -ne 0 ]; then echo "ERROR: Failed to compile example ($?)"; exit 1; fi
442+
443+
echo "Uninstalling esp32 ..."
444+
arduino-cli core uninstall esp32:esp32
445+
if [ $? -ne 0 ]; then echo "ERROR: Failed to uninstall esp32 ($?)"; exit 1; fi
446+
447+
echo "Test successful!"
448+
449+
if [ "$RELEASE_PRE" == "false" ]; then
450+
echo "Testing $PACKAGE_JSON_REL install ..."
451+
echo "Updating index ..."
452+
arduino-cli core update-index --additional-urls "file://$OUTPUT_DIR/$PACKAGE_JSON_REL"
453+
if [ $? -ne 0 ]; then echo "ERROR: Failed to update index ($?)"; exit 1; fi
454+
455+
echo "Installing esp32 ..."
456+
arduino-cli core install esp32:esp32
457+
if [ $? -ne 0 ]; then echo "ERROR: Failed to install esp32 ($?)"; exit 1; fi
458+
459+
echo "Compiling example ..."
460+
arduino-cli compile --fqbn esp32:esp32:esp32 $GITHUB_WORKSPACE/libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino
461+
if [ $? -ne 0 ]; then echo "ERROR: Failed to compile example ($?)"; exit 1; fi
462+
463+
echo "Uninstalling esp32 ..."
464+
arduino-cli core uninstall esp32:esp32
465+
if [ $? -ne 0 ]; then echo "ERROR: Failed to uninstall esp32 ($?)"; exit 1; fi
466+
467+
echo "Test successful!"
468+
fi
469+
470+
# Upload package JSONs
471+
425472
echo "Uploading $PACKAGE_JSON_DEV ..."
426473
echo "Download URL: "`git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV"`
427474
echo "Pages URL: "`git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV"`

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
with:
1818
python-version: '3.x'
1919
- run: pip install packaging
20+
- run: pip install pyserial
2021
- name: Build Release
2122
env:
2223
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

boards.txt

+559
Large diffs are not rendered by default.

cores/esp32/esp32-hal-uart.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,8 @@ int log_printfv(const char *format, va_list arg) {
895895
}
896896
#endif
897897
*/
898-
#if CONFIG_IDF_TARGET_ESP32C3 || ((CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32C6) && ARDUINO_USB_CDC_ON_BOOT)
898+
#if (ARDUINO_USB_CDC_ON_BOOT == 1 && ARDUINO_USB_MODE == 0) || CONFIG_IDF_TARGET_ESP32C3 \
899+
|| ((CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32C6) && ARDUINO_USB_CDC_ON_BOOT == 1)
899900
vsnprintf(temp, len + 1, format, arg);
900901
ets_printf("%s", temp);
901902
#else

cores/esp32/esp_arduino_version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C" {
2323
/** Minor version number (x.X.x) */
2424
#define ESP_ARDUINO_VERSION_MINOR 0
2525
/** Patch version number (x.x.X) */
26-
#define ESP_ARDUINO_VERSION_PATCH 3
26+
#define ESP_ARDUINO_VERSION_PATCH 4
2727

2828
/**
2929
* Macro to convert ARDUINO version number into an integer

docs/en/api/adc.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ADC OneShot mode
2121

2222

2323
The ADC OneShot mode API is fully compatible with Arduino's ``analogRead`` function.
24-
When you call the ``analogRead`` or ``analogReadMillivolts`` function, it returns the result of a single conversion on the requested pin.
24+
When you call the ``analogRead`` or ``analogReadMilliVolts`` function, it returns the result of a single conversion on the requested pin.
2525

2626
analogRead
2727
^^^^^^^^^^
@@ -36,7 +36,7 @@ This function is used to get the ADC raw value for a given pin/ADC channel.
3636

3737
This function will return analog raw value (non-calibrated).
3838

39-
analogReadMillivolts
39+
analogReadMilliVolts
4040
^^^^^^^^^^^^^^^^^^^^
4141

4242
This function is used to get ADC raw value for a given pin/ADC channel and convert it to calibrated result in millivolts.

docs/en/api/preferences.rst

+7-5
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ Preferences directly supports the following data types:
6262
+-------------------+-------------------+---------------+
6363
| ULong | uint32_t | 4 |
6464
+-------------------+-------------------+---------------+
65+
| Float | float_t | 4 |
66+
+-------------------+-------------------+---------------+
6567
| Long64 | int64_t | 8 |
6668
+-------------------+-------------------+---------------+
6769
| ULong64 | uint64_t | 8 |
6870
+-------------------+-------------------+---------------+
69-
| Float | float_t | 8 |
70-
+-------------------+-------------------+---------------+
7171
| Double | double_t | 8 |
7272
+-------------------+-------------------+---------------+
7373
| | const char* | variable |
@@ -258,6 +258,8 @@ Arduino-esp32 Preferences API
258258
``putInt, putUInt``
259259
********************
260260
``putLong, putULong``
261+
**********************
262+
``putFloat``
261263
**********************
262264

263265
Store a value against a given key in the currently open namespace.
@@ -268,6 +270,7 @@ Arduino-esp32 Preferences API
268270
size_t putUInt(const char* key, uint32_t value)
269271
size_t putLong(const char* key, int32_t value)
270272
size_t putULong(const char* key, uint32_t value)
273+
size_t putFloat(const char* key, float_t value)
271274
272275
..
273276
@@ -288,16 +291,15 @@ Arduino-esp32 Preferences API
288291

289292
``putLong64, putULong64``
290293
*************************
291-
``putFloat, putDouble``
292-
***********************
294+
``putDouble``
295+
*************************
293296

294297
Store a value against a given key in the currently open namespace.
295298

296299
.. code-block:: arduino
297300
298301
size_t putLong64(const char* key, int64_t value)
299302
size_t putULong64(const char* key, uint64_t value)
300-
size_t putFloat(const char* key, float_t value)
301303
size_t putDouble(const char* key, double_t value)
302304
303305
..

docs/en/tutorials/preferences.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ Preferences directly supports the following data types:
7070
+-------------------+-------------------+---------------+
7171
| ULong | uint32_t | 4 |
7272
+-------------------+-------------------+---------------+
73+
| Float | float_t | 4 |
74+
+-------------------+-------------------+---------------+
7375
| Long64 | int64_t | 8 |
7476
+-------------------+-------------------+---------------+
7577
| ULong64 | uint64_t | 8 |
7678
+-------------------+-------------------+---------------+
77-
| Float | float_t | 8 |
78-
+-------------------+-------------------+---------------+
7979
| Double | double_t | 8 |
8080
+-------------------+-------------------+---------------+
81-
| | const char* | |
82-
| String +-------------------+ variable |
81+
| | const char* | variable |
82+
| String +-------------------+ |
8383
| | String | |
8484
+-------------------+-------------------+---------------+
8585
| Bytes | uint8_t | variable |
@@ -233,9 +233,9 @@ Like so:
233233

234234
.. code-block:: arduino
235235
236-
float myFloat = myPreferences.getFloat("pi");
236+
float_t myFloat = myPreferences.getFloat("pi");
237237
238-
This will retrieve the float value from the namespace key ``"pi"`` and assign it to the float type variable ``myFloat``.
238+
This will retrieve the float_t value from the namespace key ``"pi"`` and assign it to the float_t type variable ``myFloat``.
239239

240240

241241
Summary

libraries/ArduinoOTA/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ArduinoOTA
2-
version=3.0.3
2+
version=3.0.4
33
author=Ivan Grokhotkov and Hristo Gochkov
44
maintainer=Hristo Gochkov <[email protected]>
55
sentence=Enables Over The Air upgrades, via wifi and espota.py UDP request/TCP download.

libraries/AsyncUDP/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP32 Async UDP
2-
version=3.0.3
2+
version=3.0.4
33
author=Me-No-Dev
44
maintainer=Me-No-Dev
55
sentence=Async UDP Library for ESP32

libraries/BLE/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=BLE
2-
version=3.0.3
2+
version=3.0.4
33
author=Neil Kolban <[email protected]>
44
maintainer=Dariusz Krempa <[email protected]>
55
sentence=BLE functions for ESP32

libraries/BluetoothSerial/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=BluetoothSerial
2-
version=3.0.3
2+
version=3.0.4
33
author=Evandro Copercini
44
maintainer=Evandro Copercini
55
sentence=Simple UART to Classical Bluetooth bridge for ESP32

libraries/DNSServer/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=DNSServer
2-
version=3.0.3
2+
version=3.0.4
33
author=Kristijan Novoselić
44
maintainer=Kristijan Novoselić, <[email protected]>
55
sentence=A simple DNS server for ESP32.

libraries/EEPROM/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=EEPROM
2-
version=3.0.3
2+
version=3.0.4
33
author=Ivan Grokhotkov
44
maintainer=Paolo Becchi <[email protected]>
55
sentence=Enables reading and writing data a sequential, addressable FLASH storage

libraries/ESP32/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP32
2-
version=3.0.3
2+
version=3.0.4
33
author=Hristo Gochkov, Ivan Grokhtkov
44
maintainer=Hristo Gochkov <[email protected]>
55
sentence=ESP32 sketches examples

libraries/ESP_I2S/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP_I2S
2-
version=3.0.3
2+
version=3.0.4
33
author=me-no-dev
44
maintainer=me-no-dev
55
sentence=Library for ESP I2S communication

libraries/ESP_NOW/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP_NOW
2-
version=3.0.3
2+
version=3.0.4
33
author=me-no-dev
44
maintainer=P-R-O-C-H-Y
55
sentence=Library for ESP_NOW

libraries/ESP_NOW/src/ESP32_NOW.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,19 @@ bool ESP_NOW_Class::end() {
190190
if (!_esp_now_has_begun) {
191191
return true;
192192
}
193-
//remove all peers?
193+
//remove all peers
194+
for (uint8_t i = 0; i < ESP_NOW_MAX_TOTAL_PEER_NUM; i++) {
195+
if (_esp_now_peers[i] != NULL) {
196+
removePeer(*_esp_now_peers[i]);
197+
}
198+
}
194199
esp_err_t err = esp_now_deinit();
195200
if (err != ESP_OK) {
196201
log_e("esp_now_deinit failed! 0x%x", err);
197202
return false;
198203
}
199204
_esp_now_has_begun = false;
205+
//clear the peer list
200206
memset(_esp_now_peers, 0, sizeof(ESP_NOW_Peer *) * ESP_NOW_MAX_TOTAL_PEER_NUM);
201207
return true;
202208
}
@@ -262,6 +268,10 @@ void ESP_NOW_Class::onNewPeer(void (*cb)(const esp_now_recv_info_t *info, const
262268
new_arg = arg;
263269
}
264270

271+
bool ESP_NOW_Class::removePeer(ESP_NOW_Peer &peer) {
272+
return peer.remove();
273+
}
274+
265275
ESP_NOW_Class ESP_NOW;
266276

267277
/*

libraries/ESP_NOW/src/ESP32_NOW.h

+26-21
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,31 @@
66
#include "esp32-hal-log.h"
77
#include "esp_mac.h"
88

9+
class ESP_NOW_Peer; //forward declaration for friend function
10+
11+
class ESP_NOW_Class : public Print {
12+
public:
13+
const uint8_t BROADCAST_ADDR[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
14+
15+
ESP_NOW_Class();
16+
~ESP_NOW_Class();
17+
18+
bool begin(const uint8_t *pmk = NULL /* 16 bytes */);
19+
bool end();
20+
21+
int getTotalPeerCount();
22+
int getEncryptedPeerCount();
23+
24+
int availableForWrite();
25+
size_t write(const uint8_t *data, size_t len);
26+
size_t write(uint8_t data) {
27+
return write(&data, 1);
28+
}
29+
30+
void onNewPeer(void (*cb)(const esp_now_recv_info_t *info, const uint8_t *data, int len, void *arg), void *arg);
31+
bool removePeer(ESP_NOW_Peer &peer);
32+
};
33+
934
class ESP_NOW_Peer {
1035
private:
1136
uint8_t mac[6];
@@ -47,28 +72,8 @@ class ESP_NOW_Peer {
4772
virtual void onSent(bool success) {
4873
log_i("Message transmission to peer " MACSTR " %s", MAC2STR(mac), success ? "successful" : "failed");
4974
}
50-
};
51-
52-
class ESP_NOW_Class : public Print {
53-
public:
54-
const uint8_t BROADCAST_ADDR[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
55-
56-
ESP_NOW_Class();
57-
~ESP_NOW_Class();
58-
59-
bool begin(const uint8_t *pmk = NULL /* 16 bytes */);
60-
bool end();
61-
62-
int getTotalPeerCount();
63-
int getEncryptedPeerCount();
64-
65-
int availableForWrite();
66-
size_t write(const uint8_t *data, size_t len);
67-
size_t write(uint8_t data) {
68-
return write(&data, 1);
69-
}
7075

71-
void onNewPeer(void (*cb)(const esp_now_recv_info_t *info, const uint8_t *data, int len, void *arg), void *arg);
76+
friend bool ESP_NOW_Class::removePeer(ESP_NOW_Peer &);
7277
};
7378

7479
extern ESP_NOW_Class ESP_NOW;

libraries/ESP_SR/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP_SR
2-
version=3.0.3
2+
version=3.0.4
33
author=me-no-dev
44
maintainer=me-no-dev
55
sentence=Library for ESP Sound Recognition

libraries/ESPmDNS/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESPmDNS
2-
version=3.0.3
2+
version=3.0.4
33
author=Hristo Gochkov, Ivan Grokhtkov
44
maintainer=Hristo Gochkov <[email protected]>
55
sentence=ESP32 mDNS Library

0 commit comments

Comments
 (0)