Skip to content

Commit fe70e9b

Browse files
committed
Merge branch 'release/v2.x' of https://github.com/espressif/arduino-esp32 into release/v2.x
2 parents 9817b09 + 725146d commit fe70e9b

File tree

90 files changed

+3084
-374
lines changed

Some content is hidden

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

90 files changed

+3084
-374
lines changed

.github/workflows/allboards.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ jobs:
3232
test-chunks: ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
3333

3434
steps:
35-
- uses: actions/checkout@v3
35+
- name: Checkout repository
36+
uses: actions/checkout@v3
37+
with:
38+
ref: ${{ github.event.client_payload.branch }}
39+
3640
- run: npm install
3741
- name: Setup jq
3842
uses: dcarbone/install-jq-action@v1.0.1
@@ -63,6 +67,8 @@ jobs:
6367
steps:
6468
- name: Checkout repository
6569
uses: actions/checkout@v3
70+
with:
71+
ref: ${{ github.event.client_payload.branch }}
6672

6773
- name: Echo FQBNS to file
6874
run:

boards.txt

Lines changed: 1740 additions & 240 deletions
Large diffs are not rendered by default.

cores/esp32/HWCDC.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,18 @@ void HWCDC::begin(unsigned long baud)
173173
if(tx_lock == NULL) {
174174
tx_lock = xSemaphoreCreateMutex();
175175
}
176-
setRxBufferSize(256);//default if not preset
177-
setTxBufferSize(256);//default if not preset
178-
176+
//RX Buffer default has 256 bytes if not preset
177+
if(rx_queue == NULL) {
178+
if (!setRxBufferSize(256)) {
179+
log_e("HW CDC RX Buffer error");
180+
}
181+
}
182+
//TX Buffer default has 256 bytes if not preset
183+
if (tx_ring_buf == NULL) {
184+
if (!setTxBufferSize(256)) {
185+
log_e("HW CDC TX Buffer error");
186+
}
187+
}
179188
usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
180189
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
181190
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_BUS_RESET);

cores/esp32/esp32-hal-bt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@
1616

1717
#ifdef CONFIG_BT_ENABLED
1818

19+
#if CONFIG_IDF_TARGET_ESP32
20+
bool btInUse(){ return true; }
21+
#else
1922
// user may want to change it to free resources
2023
__attribute__((weak)) bool btInUse(){ return true; }
24+
#endif
2125

2226
#include "esp_bt.h"
2327

cores/esp32/esp32-hal-gpio.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc,
167167
{
168168
static bool interrupt_initialized = false;
169169

170+
// makes sure that pin -1 (255) will never work -- this follows Arduino standard
171+
if (pin >= SOC_GPIO_PIN_COUNT) return;
172+
170173
if(!interrupt_initialized) {
171174
esp_err_t err = gpio_install_isr_service((int)ARDUINO_ISR_FLAG);
172175
interrupt_initialized = (err == ESP_OK) || (err == ESP_ERR_INVALID_STATE);

cores/esp32/esp32-hal-gpio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern "C" {
5151
#define PULLDOWN 0x08
5252
#define INPUT_PULLDOWN 0x09
5353
#define OPEN_DRAIN 0x10
54-
#define OUTPUT_OPEN_DRAIN 0x12
54+
#define OUTPUT_OPEN_DRAIN 0x13
5555
#define ANALOG 0xC0
5656

5757
//Interrupt Modes

cores/esp32/esp32-hal-ledc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,13 @@ void analogWrite(uint8_t pin, int value) {
234234
return;
235235
}
236236
ledcAttachPin(pin, channel);
237-
pin_to_channel[pin] = channel;
237+
pin_to_channel[pin] = channel + 1;
238238
ledcWrite(channel, value);
239239
}
240240
}
241241

242242
int8_t analogGetChannel(uint8_t pin) {
243-
return pin_to_channel[pin];
243+
return pin_to_channel[pin] - 1;
244244
}
245245

246246
void analogWriteFrequency(uint32_t freq) {

cores/esp32/esp32-hal-misc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,15 @@ bool verifyRollbackLater() { return false; }
209209
#endif
210210

211211
#ifdef CONFIG_BT_ENABLED
212+
#if CONFIG_IDF_TARGET_ESP32
213+
//overwritten in esp32-hal-bt.c
214+
bool btInUse() __attribute__((weak));
215+
bool btInUse(){ return false; }
216+
#else
212217
//from esp32-hal-bt.c
213218
extern bool btInUse();
214219
#endif
220+
#endif
215221

216222
void initArduino()
217223
{

docs/source/api/adc.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ This function will return analog value in millivolts.
4848
analogReadResolution
4949
^^^^^^^^^^^^^^^^^^^^
5050

51-
This function is used to set the resolution of ``analogRead`` return value. Default is 12 bits (range from 0 to 4096)
52-
for all chips except ESP32S3 where default is 13 bits (range from 0 to 8192).
51+
This function is used to set the resolution of ``analogRead`` return value. Default is 12 bits (range from 0 to 4095)
52+
for all chips except ESP32S3 where default is 13 bits (range from 0 to 8191).
5353
When different resolution is set, the values read will be shifted to match the given resolution.
5454

5555
Range is 1 - 16 .The default value will be used, if this function is not used.
@@ -205,4 +205,4 @@ Here is an example of how to use the ADC.
205205
.. literalinclude:: ../../../libraries/ESP32/examples/AnalogRead/AnalogRead.ino
206206
:language: arduino
207207

208-
Or you can run Arduino example 01.Basics -> AnalogReadSerial.
208+
Or you can run Arduino example 01.Basics -> AnalogReadSerial.

docs/source/faq.rst

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,4 @@ Note that modifying ``sdkconfig`` or ``sdkconfig.h`` files found in the arduino-
1414
How to compile libs with different debug level?
1515
-----------------------------------------------
1616

17-
The short answer is ``esp32-arduino-lib-builder/configs/defconfig.common:44``. A guide explaining the process can be found here <guides/core_debug>
18-
19-
SPIFFS mount failed
20-
-------------------
21-
When you come across and error like this:
22-
23-
.. code-block:: shell
24-
25-
E (588) SPIFFS: mount failed, -10025
26-
[E][SPIFFS.cpp:47] begin(): Mounting SPIFFS failed! Error: -1
27-
28-
Try enforcing format on fail in your code by adding ``true`` in the ``begin`` method such as this:
29-
30-
.. code-block:: c++
31-
32-
SPIFFS.begin(true);
33-
34-
See the method prototype for reference: ``bool begin(bool formatOnFail=false, const char * basePath="/spiffs", uint8_t maxOpenFiles=10, const char * partitionLabel=NULL);``
17+
The short answer is ``esp32-arduino-lib-builder/configs/defconfig.common:44``. A guide explaining the process can be found here <guides/core_debug>

0 commit comments

Comments
 (0)