Skip to content

Commit 89275ee

Browse files
authored
Merge branch 'master' into master
2 parents 493f516 + 5de09a9 commit 89275ee

File tree

349 files changed

+6460
-345
lines changed

Some content is hidden

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

349 files changed

+6460
-345
lines changed

.github/scripts/check-cmakelists.sh

+1-1
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

+26-61
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

+1
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

+25-1
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

+6-13
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

+3
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

cores/esp32/Stream.cpp

+1-1
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/esp32-hal-ledc.c

+19
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

+18-18
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

+5-5
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;

cores/esp32/esp32-hal.h

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ void yield(void);
9090
#include "esp32-hal-psram.h"
9191
#include "esp32-hal-cpu.h"
9292

93+
void analogWrite(uint8_t pin, int value);
94+
9395
//returns chip temperature in Celsius
9496
float temperatureRead();
9597

78.1 KB
Loading
114 KB
Loading

0 commit comments

Comments
 (0)