Skip to content

Commit ab05844

Browse files
authored
Merge branch 'master' into NanoC6
2 parents 4b72aad + 4e3523c commit ab05844

File tree

17 files changed

+872
-9
lines changed

17 files changed

+872
-9
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ repos:
3434
hooks:
3535
- id: clang-format
3636
types_or: [c, c++]
37+
exclude: ^.*\/build_opt\.h$
3738
- repo: https://github.com/psf/black-pre-commit-mirror
3839
rev: "22.10.0"
3940
hooks:

boards.txt

Lines changed: 363 additions & 0 deletions
Large diffs are not rendered by default.

cores/esp32/esp32-hal-gpio.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
#include "hal/gpio_hal.h"
1818
#include "soc/soc_caps.h"
1919

20+
// RGB_BUILTIN is defined in pins_arduino.h
21+
// If RGB_BUILTIN is defined, it will be used as a pin number for the RGB LED
22+
// If RGB_BUILTIN has a side effect that prevents using RMT Legacy driver in IDF 5.1
23+
// Define ESP32_ARDUINO_NO_RGB_BUILTIN in build_opt.h or through CLI to disable RGB_BUILTIN
24+
#ifdef ESP32_ARDUINO_NO_RGB_BUILTIN
25+
#ifdef RGB_BUILTIN
26+
#undef RGB_BUILTIN
27+
#endif
28+
#endif
29+
2030
// It fixes lack of pin definition for S3 and for any future SoC
2131
// this function works for ESP32, ESP32-S2 and ESP32-S3 - including the C3, it will return -1 for any pin
2232
#if SOC_TOUCH_SENSOR_NUM > 0
@@ -159,7 +169,7 @@ extern void ARDUINO_ISR_ATTR __digitalWrite(uint8_t pin, uint8_t val) {
159169
neopixelWrite(RGB_BUILTIN, comm_val, comm_val, comm_val);
160170
return;
161171
}
162-
#endif
172+
#endif // RGB_BUILTIN
163173
if (perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) != NULL) {
164174
gpio_set_level((gpio_num_t)pin, val);
165175
} else {

cores/esp32/esp32-hal-uart.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,16 @@ uart_t *uartBegin(
513513
retCode &= ESP_OK == uart_param_config(uart_nr, &uart_config);
514514
}
515515

516-
// Is it right or the idea is to swap rx and tx pins?
517-
if (retCode && inverted) {
518-
// invert signal for both Rx and Tx
519-
retCode &= ESP_OK == uart_set_line_inverse(uart_nr, UART_SIGNAL_TXD_INV | UART_SIGNAL_RXD_INV);
516+
if (retCode) {
517+
if (inverted) {
518+
// invert signal for both Rx and Tx
519+
retCode &= ESP_OK == uart_set_line_inverse(uart_nr, UART_SIGNAL_TXD_INV | UART_SIGNAL_RXD_INV);
520+
} else {
521+
// disable invert signal for both Rx and Tx
522+
retCode &= ESP_OK == uart_set_line_inverse(uart_nr, UART_SIGNAL_INV_DISABLE);
523+
}
520524
}
521-
525+
// if all fine, set internal parameters
522526
if (retCode) {
523527
uart->_baudrate = baudrate;
524528
uart->_config = config;

docs/en/api/i2s.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,9 @@ Sample code
546546
I2S.read();
547547
available_bytes = I2S.available();
548548
if(available_bytes < buff_size) {
549-
read_bytes = I2S.read(buffer, available_bytes);
549+
read_bytes = I2S.readBytes(buffer, available_bytes);
550550
} else {
551-
read_bytes = I2S.read(buffer, buff_size);
551+
read_bytes = I2S.readBytes(buffer, buff_size);
552552
}
553553
I2S.write(buffer, read_bytes);
554554
I2S.end();

docs/en/lib_builder.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,26 @@ Specify additional configs to be applied. ex. 'qio 80m' to compile for QIO Flash
181181
182182
./build.sh -t esp32 -b idf_libs qio 80m
183183
184+
User Interface
185+
--------------
186+
187+
There is also a terminal user interface that can be used to configure the libraries to be compiled.
188+
It allows the user to select the targets to compile, change the configuration options and compile the libraries.
189+
It has mouse support and can be pre-configured using command line arguments.
190+
For more information and troubleshooting, check `the documentation <https://github.com/espressif/esp32-arduino-lib-builder/blob/master/tools/config_editor/README.md>`_.
191+
192+
To use the terminal user interface, make sure to have ``python>=3.9``, all the previous dependencies and install the ``textual`` library:
193+
194+
.. code-block:: bash
195+
196+
pip install --user textual
197+
198+
You can then run the UI using the following command:
199+
200+
.. code-block:: bash
201+
202+
./tools/config_editor/app.py
203+
184204
Docker Image
185205
------------
186206

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* This example demonstrates how to use the file build_opt.h to disable the new RMT Driver
3+
* Note that this file shall be added the Arduino project
4+
*
5+
* If the content of this file changes, it is necessary to delete the compiled Arduino IDE cache
6+
* It can be done by changing, for instance, the "Core Debug Level" option, forcing the system to rebuild the Arduino Core
7+
*
8+
*/
9+
10+
#ifndef ESP32_ARDUINO_NO_RGB_BUILTIN
11+
12+
// add the file "build_opt.h" to your Arduino project folder with "-DESP32_ARDUINO_NO_RGB_BUILTIN" to use the RMT Legacy driver
13+
#error "ESP32_ARDUINO_NO_RGB_BUILTIN is not defined, this example is intended to demonstrate the RMT Legacy driver.
14+
#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'"
16+
17+
#else
18+
19+
// add the file "build_opt.h" to your Arduino project folder with "-DESP32_ARDUINO_NO_RGB_BUILTIN" to use the RMT Legacy driver
20+
// neoPixelWrite() is a function that writes to the RGB LED and it won't be available here
21+
#include "driver/rmt.h"
22+
23+
bool installed = false;
24+
25+
void setup() {
26+
Serial.begin(115200);
27+
Serial.println("This sketch is using the RMT Legacy driver.");
28+
installed = rmt_driver_install(RMT_CHANNEL_0, 0, 0) == ESP_OK;
29+
}
30+
31+
void loop() {
32+
String msg = "RMT Legacy driver is installed: ";
33+
msg += (char *)(installed ? "Yes." : "No.");
34+
Serial.println(msg);
35+
delay(5000);
36+
}
37+
38+
#endif // ESP32_ARDUINO_NO_RGB_BUILTIN
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-DESP32_ARDUINO_NO_RGB_BUILTIN

libraries/Network/src/NetworkInterface.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,15 @@ bool NetworkInterface::hasGlobalIPv6() const {
320320
bool NetworkInterface::enableIPv6(bool en) {
321321
if (en) {
322322
setStatusBits(ESP_NETIF_WANT_IP6_BIT);
323+
if (_esp_netif != NULL && connected()) {
324+
// If we are already connected, try to enable IPv6 immediately
325+
esp_err_t err = esp_netif_create_ip6_linklocal(_esp_netif);
326+
if (err != ESP_OK) {
327+
log_e("Failed to enable IPv6 Link Local on %s: [%d] %s", desc(), err, esp_err_to_name(err));
328+
} else {
329+
log_v("Enabled IPv6 Link Local on %s", desc());
330+
}
331+
}
323332
} else {
324333
clearStatusBits(ESP_NETIF_WANT_IP6_BIT);
325334
}

libraries/WiFiProv/examples/WiFiProv/WiFiProv.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ void SysProvEvent(arduino_event_t *sys_event) {
5353

5454
void setup() {
5555
Serial.begin(115200);
56+
WiFi.begin(); // no SSID/PWD - get it from the Provisioning APP or from NVS (last successful connection)
5657
WiFi.onEvent(SysProvEvent);
5758

5859
// BLE Provisioning using the ESP SoftAP Prov works fine for any BLE SoC, including ESP32, ESP32S3 and ESP32C3.
@@ -61,7 +62,7 @@ void setup() {
6162
// Sample uuid that user can pass during provisioning using BLE
6263
uint8_t uuid[16] = {0xb4, 0xdf, 0x5a, 0x1c, 0x3f, 0x6b, 0xf4, 0xbf, 0xea, 0x4a, 0x82, 0x03, 0x04, 0x90, 0x1a, 0x02};
6364
WiFiProv.beginProvision(
64-
WIFI_PROV_SCHEME_BLE, WIFI_PROV_SCHEME_HANDLER_FREE_BTDM, WIFI_PROV_SECURITY_1, pop, service_name, service_key, uuid, reset_provisioned
65+
WIFI_PROV_SCHEME_BLE, WIFI_PROV_SCHEME_HANDLER_FREE_BLE, WIFI_PROV_SECURITY_1, pop, service_name, service_key, uuid, reset_provisioned
6566
);
6667
log_d("ble qr");
6768
WiFiProv.printQR(service_name, pop, "ble");

0 commit comments

Comments
 (0)