Skip to content

Commit dee2f0e

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fix_streamLoad
2 parents 3b31484 + 399f4ec commit dee2f0e

File tree

410 files changed

+10033
-1058
lines changed

Some content is hidden

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

410 files changed

+10033
-1058
lines changed

.github/scripts/check-cmakelists.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ git submodule update --init --recursive
1515
REPO_SRCS=`find cores/esp32/ libraries/ -name 'examples' -prune -o -name '*.c' -print -o -name '*.cpp' -print | sort`
1616

1717
# find all source files named in CMakeLists.txt COMPONENT_SRCS
18-
CMAKE_SRCS=`cmake --trace-expand -C CMakeLists.txt 2>&1 | grep set\(srcs | cut -d'(' -f3 | sed 's/ )//' | sed 's/srcs //' | tr ' ;' '\n' | sort`
18+
CMAKE_SRCS=`cmake --trace-expand -P CMakeLists.txt 2>&1 | grep set\(srcs | cut -d'(' -f3 | sed 's/ )//' | sed 's/srcs //' | tr ' ;' '\n' | sort`
1919

2020
if ! diff -u0 --label "Repo Files" --label "srcs" <(echo "$REPO_SRCS") <(echo "$CMAKE_SRCS"); then
2121
echo "Source files in repo (-) and source files in CMakeLists.txt (+) don't match"

.github/stale.yml

Lines changed: 26 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,26 @@
1-
# Configuration for probot-stale - https://github.com/probot/stale
2-
3-
# Number of days of inactivity before an Issue or Pull Request becomes stale
4-
daysUntilStale: 60
5-
6-
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7-
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
8-
daysUntilClose: 14
9-
10-
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
11-
onlyLabels: []
12-
13-
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
14-
exemptLabels:
15-
- "Type: For reference"
16-
- "Type: To be implemented"
17-
- "Type: Feature request"
18-
19-
# Set to true to ignore issues in a project (defaults to false)
20-
exemptProjects: false
21-
22-
# Set to true to ignore issues in a milestone (defaults to false)
23-
exemptMilestones: false
24-
25-
# Set to true to ignore issues with an assignee (defaults to false)
26-
exemptAssignees: false
27-
28-
# Label to use when marking as stale
29-
staleLabel: "Status: Stale"
30-
31-
# Comment to post when marking as stale. Set to `false` to disable
32-
markComment: >
33-
[STALE_SET] This issue has been automatically marked as stale because it has not had
34-
recent activity. It will be closed in 14 days if no further activity occurs. Thank you
35-
for your contributions.
36-
37-
# Comment to post when removing the stale label.
38-
unmarkComment: >
39-
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.
40-
41-
# Comment to post when closing a stale Issue or Pull Request.
42-
closeComment: >
43-
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.
44-
45-
# Limit the number of actions per hour, from 1-30. Default is 30
46-
limitPerRun: 30
47-
48-
# Limit to only `issues` or `pulls`
49-
only: issues
50-
51-
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
52-
# pulls:
53-
# daysUntilStale: 30
54-
# markComment: >
55-
# This pull request has been automatically marked as stale because it has not had
56-
# recent activity. It will be closed if no further activity occurs. Thank you
57-
# for your contributions.
58-
59-
# issues:
60-
# exemptLabels:
61-
# - confirmed
1+
# This workflow firstly warns and then closes issues that have had no activity for a specified amount of time.
2+
#
3+
# You can adjust the behavior by modifying this file.
4+
# For more information can be found here: https://github.com/actions/stale
5+
6+
name: Mark stale issues
7+
on:
8+
schedule:
9+
- cron: '30 9 * * *'
10+
11+
jobs:
12+
stale:
13+
14+
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
18+
steps:
19+
- uses: actions/stale@v3
20+
with:
21+
repo-token: ${{ secrets.GITHUB_TOKEN }}
22+
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.'
23+
days-before-stale: 60
24+
days-before-close: 14
25+
exempt-issue-labels: 'Type: For reference,Type: To be implemented,Type: Feature request'
26+
stale-issue-label: 'Status: Stale'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ boards.sloeber.txt
2121

2222
# Ignore docs build (Sphinx)
2323
docs/build
24+
docs/source/_build

CMakeLists.txt

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# Check ESP-IDF version and error out if it is not in the supported range.
2+
#
3+
# Note for arduino-esp32 developers: to bypass the version check locally,
4+
# set ARDUINO_SKIP_IDF_VERSION_CHECK environment variable to 1. For example:
5+
# export ARDUINO_SKIP_IDF_VERSION_CHECK=1
6+
# idf.py build
7+
8+
set(min_supported_idf_version "4.4.0")
9+
set(max_supported_idf_version "4.4.99")
10+
set(idf_version "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}.${IDF_VERSION_PATCH}")
11+
12+
if ("${idf_version}" AND NOT "$ENV{ARDUINO_SKIP_IDF_VERSION_CHECK}")
13+
if (idf_version VERSION_LESS min_supported_idf_version)
14+
message(FATAL_ERROR "Arduino-esp32 can be used with ESP-IDF versions "
15+
"between ${min_supported_idf_version} and ${max_supported_idf_version}, "
16+
"but an older version is detected: ${idf_version}.")
17+
endif()
18+
if (idf_version VERSION_GREATER max_supported_idf_version)
19+
message(FATAL_ERROR "Arduino-esp32 can be used with ESP-IDF versions "
20+
"between ${min_supported_idf_version} and ${max_supported_idf_version}, "
21+
"but a newer version is detected: ${idf_version}.")
22+
endif()
23+
endif()
24+
125
set(CORE_SRCS
226
cores/esp32/base64.cpp
327
cores/esp32/cbuf.cpp
@@ -55,6 +79,7 @@ set(LIBRARY_SRCS
5579
libraries/DNSServer/src/DNSServer.cpp
5680
libraries/EEPROM/src/EEPROM.cpp
5781
libraries/ESPmDNS/src/ESPmDNS.cpp
82+
libraries/Ethernet/src/ETH.cpp
5883
libraries/FFat/src/FFat.cpp
5984
libraries/FS/src/FS.cpp
6085
libraries/FS/src/vfs_api.cpp
@@ -91,7 +116,6 @@ set(LIBRARY_SRCS
91116
libraries/WebServer/src/detail/mimetable.cpp
92117
libraries/WiFiClientSecure/src/ssl_client.cpp
93118
libraries/WiFiClientSecure/src/WiFiClientSecure.cpp
94-
libraries/WiFi/src/ETH.cpp
95119
libraries/WiFi/src/WiFiAP.cpp
96120
libraries/WiFi/src/WiFiClient.cpp
97121
libraries/WiFi/src/WiFi.cpp

README.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
1-
# Arduino core for the ESP32
1+
# Arduino core for the ESP32, ESP32-S2 and ESP32-C3
22

3-
[![Build Status](https://travis-ci.org/espressif/arduino-esp32.svg?branch=master)](https://travis-ci.org/espressif/arduino-esp32) ![](https://github.com/espressif/arduino-esp32/workflows/ESP32%20Arduino%20CI/badge.svg) [![Documentation Status](https://readthedocs.com/projects/espressif-arduino-esp32/badge/?version=latest)](https://docs.espressif.com/projects/arduino-esp32/en/latest/?badge=latest)
3+
![Build Status](https://github.com/espressif/arduino-esp32/workflows/ESP32%20Arduino%20CI/badge.svg) [![Documentation Status](https://readthedocs.com/projects/espressif-arduino-esp32/badge/?version=latest)](https://docs.espressif.com/projects/arduino-esp32/en/latest/?badge=latest)
44

55
### Need help or have a question? Join the chat at [![https://gitter.im/espressif/arduino-esp32](https://badges.gitter.im/espressif/arduino-esp32.svg)](https://gitter.im/espressif/arduino-esp32?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
66

77
## Contents
88

9-
- [ESP32-S2 and ESP32-C3 Support](#esp32-s2-and-esp32-c3-support)
109
- [Development Status](#development-status)
1110
- [Decoding Exceptions](#decoding-exceptions)
1211
- [Issue/Bug report template](#issuebug-report-template)
1312

14-
### ESP32-S2 and ESP32-C3 Support
15-
16-
If you want to test ESP32-S2 and/or ESP32-C3 through the board manager, please use the development release link:
17-
18-
```
19-
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
20-
```
21-
22-
Now you can install the latest 2.0.0 version from the boards manager.
23-
2413
### Development Status
2514

2615
Latest Stable Release [![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Release Date](https://img.shields.io/github/release-date/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Downloads](https://img.shields.io/github/downloads/espressif/arduino-esp32/latest/total.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/)
@@ -38,6 +27,10 @@ You can use [Arduino-ESP32 Online Documentation](https://docs.espressif.com/proj
3827
* [FAQ](https://docs.espressif.com/projects/arduino-esp32/en/latest/faq.html)
3928
* [Troubleshooting](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html)
4029

30+
### Supported Chips
31+
32+
Visit the [supported chips](https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html#supported-soc-s) documentation to see the list of current supported ESP32 SoCs.
33+
4134
### Decoding exceptions
4235

4336
You can use [EspExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder) to get meaningful call trace.

boards.txt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,6 +2571,9 @@ esp32micromod.upload.extra_flags=
25712571
esp32micromod.serial.disableDTR=true
25722572
esp32micromod.serial.disableRTS=true
25732573

2574+
esp32micromod.build.tarch=xtensa
2575+
esp32micromod.build.bootloader_addr=0x1000
2576+
esp32micromod.build.target=esp32
25742577
esp32micromod.build.mcu=esp32
25752578
esp32micromod.build.core=esp32
25762579
esp32micromod.build.variant=esp32micromod
@@ -9687,10 +9690,20 @@ deneyapmini.build.boot=qio
96879690
deneyapmini.build.partitions=default
96889691
deneyapmini.build.defines=
96899692

9690-
deneyapmini.menu.CDCOnBoot.default=Disabled
9691-
deneyapmini.menu.CDCOnBoot.default.build.cdc_on_boot=0
9692-
deneyapmini.menu.CDCOnBoot.cdc=Enabled
9693-
deneyapmini.menu.CDCOnBoot.cdc.build.cdc_on_boot=1
9693+
deneyapmini.menu.CDCOnBoot.default=Enabled
9694+
deneyapmini.menu.CDCOnBoot.default.build.cdc_on_boot=1
9695+
deneyapmini.menu.CDCOnBoot.cdc=Disabled
9696+
deneyapmini.menu.CDCOnBoot.cdc.build.cdc_on_boot=0
9697+
9698+
deneyapmini.menu.MSCOnBoot.default=Disabled
9699+
deneyapmini.menu.MSCOnBoot.default.build.msc_on_boot=0
9700+
deneyapmini.menu.MSCOnBoot.msc=Enabled
9701+
deneyapmini.menu.MSCOnBoot.msc.build.msc_on_boot=1
9702+
9703+
deneyapmini.menu.DFUOnBoot.default=Disabled
9704+
deneyapmini.menu.DFUOnBoot.default.build.dfu_on_boot=0
9705+
deneyapmini.menu.DFUOnBoot.dfu=Enabled
9706+
deneyapmini.menu.DFUOnBoot.dfu.build.dfu_on_boot=1
96949707

96959708
deneyapmini.menu.PSRAM.disabled=Disabled
96969709
deneyapmini.menu.PSRAM.disabled.build.defines=

cores/esp32/Stream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ float Stream::parseFloat(char skipChar)
256256
} else if(c >= '0' && c <= '9') { // is c a digit?
257257
value = value * 10 + c - '0';
258258
if(isFraction) {
259-
fraction *= 0.1;
259+
fraction *= 0.1f;
260260
}
261261
}
262262
read(); // consume the character we got with peek

cores/esp32/cbuf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class cbuf
6262

6363
cbuf *next;
6464

65-
private:
65+
protected:
6666
inline char* wrap_if_bufend(char* ptr) const
6767
{
6868
return (ptr == _bufend) ? _buf : ptr;

cores/esp32/esp32-hal-i2c-slave.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t
302302
i2c_ll_slave_init(i2c->dev);
303303
i2c_ll_set_fifo_mode(i2c->dev, true);
304304
i2c_ll_set_slave_addr(i2c->dev, slaveID, false);
305-
i2c_ll_set_tout(i2c->dev, 32000);
305+
i2c_ll_set_tout(i2c->dev, I2C_LL_MAX_TIMEOUT);
306306
i2c_slave_set_frequency(i2c, frequency);
307307

308308
if (!i2c_slave_check_line_state(sda, scl)) {

cores/esp32/esp32-hal-i2c.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "soc/soc_caps.h"
2525
#include "soc/i2c_periph.h"
2626
#include "hal/i2c_hal.h"
27+
#include "hal/i2c_ll.h"
2728
#include "driver/i2c.h"
2829

2930
typedef volatile struct {
@@ -91,6 +92,8 @@ esp_err_t i2cInit(uint8_t i2c_num, int8_t sda, int8_t scl, uint32_t frequency){
9192
} else {
9293
bus[i2c_num].initialized = true;
9394
bus[i2c_num].frequency = frequency;
95+
//Clock Stretching Timeout: 20b:esp32, 5b:esp32-c3, 24b:esp32-s2
96+
i2c_set_timeout((i2c_port_t)i2c_num, I2C_LL_MAX_TIMEOUT);
9497
}
9598
}
9699
#if !CONFIG_DISABLE_HAL_LOCKS

cores/esp32/esp32-hal-ledc.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "freertos/task.h"
1818
#include "freertos/semphr.h"
1919
#include "esp32-hal-matrix.h"
20+
#include "soc/soc_caps.h"
2021
#include "soc/ledc_reg.h"
2122
#include "soc/ledc_struct.h"
2223
#include "driver/periph_ctrl.h"
@@ -331,3 +332,21 @@ double ledcChangeFrequency(uint8_t chan, double freq, uint8_t bit_num)
331332
double res_freq = _ledcSetupTimerFreq(chan, freq, bit_num);
332333
return res_freq;
333334
}
335+
336+
static int8_t pin_to_channel[SOC_GPIO_PIN_COUNT] = { 0 };
337+
static int cnt_channel = SOC_LEDC_CHANNEL_NUM;
338+
void analogWrite(uint8_t pin, int value) {
339+
// Use ledc hardware for internal pins
340+
if (pin < SOC_GPIO_PIN_COUNT) {
341+
if (pin_to_channel[pin] == 0) {
342+
if (!cnt_channel) {
343+
log_e("No more analogWrite channels available! You can have maximum %u", SOC_LEDC_CHANNEL_NUM);
344+
return;
345+
}
346+
pin_to_channel[pin] = cnt_channel--;
347+
ledcAttachPin(pin, cnt_channel);
348+
ledcSetup(cnt_channel, 1000, 8);
349+
}
350+
ledcWrite(pin_to_channel[pin] - 1, value);
351+
}
352+
}

cores/esp32/esp32-hal-log.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ void log_print_buf(const uint8_t *b, size_t len);
9999
#define log_buf_v(b,l) do {ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_VERBOSE);}while(0)
100100
#endif
101101
#else
102-
#define log_v(format, ...)
103-
#define isr_log_v(format, ...)
104-
#define log_buf_v(b,l)
102+
#define log_v(format, ...) do {} while(0)
103+
#define isr_log_v(format, ...) do {} while(0)
104+
#define log_buf_v(b,l) do {} while(0)
105105
#endif
106106

107107
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
@@ -115,9 +115,9 @@ void log_print_buf(const uint8_t *b, size_t len);
115115
#define log_buf_d(b,l) do {ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_DEBUG);}while(0)
116116
#endif
117117
#else
118-
#define log_d(format, ...)
119-
#define isr_log_d(format, ...)
120-
#define log_buf_d(b,l)
118+
#define log_d(format, ...) do {} while(0)
119+
#define isr_log_d(format, ...) do {} while(0)
120+
#define log_buf_d(b,l) do {} while(0)
121121
#endif
122122

123123
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
@@ -131,9 +131,9 @@ void log_print_buf(const uint8_t *b, size_t len);
131131
#define log_buf_i(b,l) do {ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_INFO);}while(0)
132132
#endif
133133
#else
134-
#define log_i(format, ...)
135-
#define isr_log_i(format, ...)
136-
#define log_buf_i(b,l)
134+
#define log_i(format, ...) do {} while(0)
135+
#define isr_log_i(format, ...) do {} while(0)
136+
#define log_buf_i(b,l) do {} while(0)
137137
#endif
138138

139139
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_WARN
@@ -147,9 +147,9 @@ void log_print_buf(const uint8_t *b, size_t len);
147147
#define log_buf_w(b,l) do {ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_WARN);}while(0)
148148
#endif
149149
#else
150-
#define log_w(format, ...)
151-
#define isr_log_w(format, ...)
152-
#define log_buf_w(b,l)
150+
#define log_w(format, ...) do {} while(0)
151+
#define isr_log_w(format, ...) do {} while(0)
152+
#define log_buf_w(b,l) do {} while(0)
153153
#endif
154154

155155
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_ERROR
@@ -163,9 +163,9 @@ void log_print_buf(const uint8_t *b, size_t len);
163163
#define log_buf_e(b,l) do {ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_ERROR);}while(0)
164164
#endif
165165
#else
166-
#define log_e(format, ...)
167-
#define isr_log_e(format, ...)
168-
#define log_buf_e(b,l)
166+
#define log_e(format, ...) do {} while(0)
167+
#define isr_log_e(format, ...) do {} while(0)
168+
#define log_buf_e(b,l) do {} while(0)
169169
#endif
170170

171171
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_NONE
@@ -179,9 +179,9 @@ void log_print_buf(const uint8_t *b, size_t len);
179179
#define log_buf_n(b,l) do {ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_ERROR);}while(0)
180180
#endif
181181
#else
182-
#define log_n(format, ...)
183-
#define isr_log_n(format, ...)
184-
#define log_buf_n(b,l)
182+
#define log_n(format, ...) do {} while(0)
183+
#define isr_log_n(format, ...) do {} while(0)
184+
#define log_buf_n(b,l) do {} while(0)
185185
#endif
186186

187187
#include "esp_log.h"

cores/esp32/esp32-hal-rmt.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,16 +546,16 @@ float rmtSetTick(rmt_obj_t* rmt, float tick)
546546
size_t channel = rmt->channel;
547547

548548
#if CONFIG_IDF_TARGET_ESP32C3
549-
int apb_div = _LIMIT(tick/25.0, 256);
550-
float apb_tick = 25.0 * apb_div;
549+
int apb_div = _LIMIT(tick/25.0f, 256);
550+
float apb_tick = 25.0f * apb_div;
551551
RMT.tx_conf[channel].div_cnt = apb_div & 0xFF;
552552
RMT.tx_conf[channel].conf_update = 1;
553553
return apb_tick;
554554
#else
555-
int apb_div = _LIMIT(tick/12.5, 256);
555+
int apb_div = _LIMIT(tick/12.5f, 256);
556556
int ref_div = _LIMIT(tick/1000, 256);
557-
float apb_tick = 12.5 * apb_div;
558-
float ref_tick = 1000.0 * ref_div;
557+
float apb_tick = 12.5f * apb_div;
558+
float ref_tick = 1000.0f * ref_div;
559559
if (_ABS(apb_tick - tick) < _ABS(ref_tick - tick)) {
560560
RMT.conf_ch[channel].conf0.div_cnt = apb_div & 0xFF;
561561
RMT.conf_ch[channel].conf1.ref_always_on = 1;

0 commit comments

Comments
 (0)