Skip to content

Commit 186c478

Browse files
authored
Merge branch 'master' into master
2 parents e49eae0 + c45cff5 commit 186c478

File tree

1,280 files changed

+57179
-11010
lines changed

Some content is hidden

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

1,280 files changed

+57179
-11010
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
----------------------------------------------------------------------------------------------------------------------------------------------------
2+
This entire section can be deleted if all items are checked.
3+
4+
*By completing this PR sufficiently, you help us to improve the quality of Release Notes*
5+
6+
### Checklist
7+
8+
1. [ ] Please provide specific title of the PR describing the change, including the component name (eg."Update of Documentation link on Readme.md")
9+
2. [ ] Please provide related links (eg. Issue, other Project, submodule PR..)
10+
----------------------------------------------------------------------------------------------------------------------------------------------------
11+
12+
## Summary
13+
Please describe your proposed PR and what it contains.
14+
15+
## Impact
16+
Please describe impact of your PR and it's function.

.github/scripts/install-platformio-esp32.sh

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,43 @@
11
#!/bin/bash
22

33
export PLATFORMIO_ESP32_PATH="$HOME/.platformio/packages/framework-arduinoespressif32"
4-
PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git#feature/idf-master"
4+
PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git#feature/arduino-idf-master"
5+
6+
XTENSA32_TOOLCHAIN_VERSION="8.4.0+2021r1"
7+
XTENSA32S2_TOOLCHAIN_VERSION="8.4.0+2021r1"
8+
RISCV_TOOLCHAIN_VERSION="8.4.0+2021r1"
9+
ESPTOOLPY_VERSION="~1.30100.0"
10+
ESPRESSIF_ORGANIZATION_NAME="espressif"
511

612
echo "Installing Python Wheel ..."
713
pip install wheel > /dev/null 2>&1
814

915
echo "Installing PlatformIO ..."
10-
pip install -U https://github.com/platformio/platformio/archive/develop.zip > /dev/null 2>&1
16+
pip install -U https://github.com/platformio/platformio/archive/master.zip > /dev/null 2>&1
1117

1218
echo "Installing Platform ESP32 ..."
13-
python -m platformio platform install $PLATFORMIO_ESP32_URL > /dev/null 2>&1
14-
15-
echo "Replacing the framework version ..."
16-
python -c "import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/espressif32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-arduinoespressif32']['version'] = '*'; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()"
19+
python -m platformio platform install $PLATFORMIO_ESP32_URL > /dev/null 2>&1
20+
21+
echo "Replacing the package versions ..."
22+
replace_script="import json; import os;"
23+
replace_script+="fp=open(os.path.expanduser('~/.platformio/platforms/espressif32/platform.json'), 'r+');"
24+
replace_script+="data=json.load(fp);"
25+
# Use framework sources from the repository
26+
replace_script+="data['packages']['framework-arduinoespressif32']['version'] = '*';"
27+
replace_script+="del data['packages']['framework-arduinoespressif32']['owner'];"
28+
# Use toolchain packages from the "espressif" organization
29+
replace_script+="data['packages']['toolchain-xtensa-esp32']['owner']='$ESPRESSIF_ORGANIZATION_NAME';"
30+
replace_script+="data['packages']['toolchain-xtensa-esp32s2']['owner']='$ESPRESSIF_ORGANIZATION_NAME';"
31+
replace_script+="data['packages']['toolchain-riscv32-esp']['owner']='$ESPRESSIF_ORGANIZATION_NAME';"
32+
# Update versions to use the upstream
33+
replace_script+="data['packages']['toolchain-xtensa-esp32']['version']='$XTENSA32_TOOLCHAIN_VERSION';"
34+
replace_script+="data['packages']['toolchain-xtensa-esp32s2']['version']='$XTENSA32S2_TOOLCHAIN_VERSION';"
35+
replace_script+="data['packages']['toolchain-riscv32-esp']['version']='$RISCV_TOOLCHAIN_VERSION';"
36+
# esptool.py may require an upstream version (for now platformio is the owner)
37+
replace_script+="data['packages']['tool-esptoolpy']['version']='$ESPTOOLPY_VERSION';"
38+
# Save results
39+
replace_script+="fp.seek(0);fp.truncate();json.dump(data, fp, indent=2);fp.close()"
40+
python -c "$replace_script"
1741

1842
if [ "$GITHUB_REPOSITORY" == "espressif/arduino-esp32" ]; then
1943
echo "Linking Core..."

.github/scripts/on-pages.sh

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -85,53 +85,59 @@ function git_safe_upload_to_pages(){
8585
return $?
8686
}
8787

88-
EVENT_JSON=`cat $GITHUB_EVENT_PATH`
89-
90-
echo "GITHUB_EVENT_PATH: $GITHUB_EVENT_PATH"
91-
echo "EVENT_JSON: $EVENT_JSON"
92-
93-
pages_added=`echo "$EVENT_JSON" | jq -r '.commits[].added[]'`
94-
echo "added: $pages_added"
95-
pages_modified=`echo "$EVENT_JSON" | jq -r '.commits[].modified[]'`
96-
echo "modified: $pages_modified"
97-
pages_removed=`echo "$EVENT_JSON" | jq -r '.commits[].removed[]'`
98-
echo "removed: $pages_removed"
99-
100-
for page in $pages_added; do
101-
if [[ $page != "README.md" && $page != "docs/"* ]]; then
102-
continue
103-
fi
104-
echo "Adding '$page' to pages ..."
105-
if [[ $page == "README.md" ]]; then
106-
git_safe_upload_to_pages "index.md" "README.md"
107-
else
108-
git_safe_upload_to_pages "$page" "$page"
109-
fi
110-
done
111-
112-
for page in $pages_modified; do
113-
if [[ $page != "README.md" && $page != "docs/"* ]]; then
114-
continue
115-
fi
116-
echo "Modifying '$page' ..."
117-
if [[ $page == "README.md" ]]; then
118-
git_safe_upload_to_pages "index.md" "README.md"
119-
else
120-
git_safe_upload_to_pages "$page" "$page"
121-
fi
122-
done
123-
124-
for page in $pages_removed; do
125-
if [[ $page != "README.md" && $page != "docs/"* ]]; then
126-
continue
127-
fi
128-
echo "Removing '$page' from pages ..."
129-
if [[ $page == "README.md" ]]; then
130-
git_remove_from_pages "README.md" > /dev/null
131-
else
132-
git_remove_from_pages "$page" > /dev/null
133-
fi
134-
done
88+
git_safe_upload_to_pages "index.md" "README.md"
89+
90+
# At some point github stopped providing a list of edited file
91+
# but we also stopped havong documentation in md format,
92+
# so we can skip this portion safely and update just the index
93+
94+
# EVENT_JSON=`cat $GITHUB_EVENT_PATH`
95+
96+
# echo "GITHUB_EVENT_PATH: $GITHUB_EVENT_PATH"
97+
# echo "EVENT_JSON: $EVENT_JSON"
98+
99+
# pages_added=`echo "$EVENT_JSON" | jq -r '.commits[].added[]'`
100+
# echo "added: $pages_added"
101+
# pages_modified=`echo "$EVENT_JSON" | jq -r '.commits[].modified[]'`
102+
# echo "modified: $pages_modified"
103+
# pages_removed=`echo "$EVENT_JSON" | jq -r '.commits[].removed[]'`
104+
# echo "removed: $pages_removed"
105+
106+
# for page in $pages_added; do
107+
# if [[ $page != "README.md" && $page != "docs/"* ]]; then
108+
# continue
109+
# fi
110+
# echo "Adding '$page' to pages ..."
111+
# if [[ $page == "README.md" ]]; then
112+
# git_safe_upload_to_pages "index.md" "README.md"
113+
# else
114+
# git_safe_upload_to_pages "$page" "$page"
115+
# fi
116+
# done
117+
118+
# for page in $pages_modified; do
119+
# if [[ $page != "README.md" && $page != "docs/"* ]]; then
120+
# continue
121+
# fi
122+
# echo "Modifying '$page' ..."
123+
# if [[ $page == "README.md" ]]; then
124+
# git_safe_upload_to_pages "index.md" "README.md"
125+
# else
126+
# git_safe_upload_to_pages "$page" "$page"
127+
# fi
128+
# done
129+
130+
# for page in $pages_removed; do
131+
# if [[ $page != "README.md" && $page != "docs/"* ]]; then
132+
# continue
133+
# fi
134+
# echo "Removing '$page' from pages ..."
135+
# if [[ $page == "README.md" ]]; then
136+
# git_remove_from_pages "README.md" > /dev/null
137+
# else
138+
# git_remove_from_pages "$page" > /dev/null
139+
# fi
140+
# done
135141

136142
echo
137143
echo "DONE!"

.github/workflows/docs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: ReadTheDocs CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release/*
8+
paths:
9+
- 'docs/**'
10+
- '.github/workflows/docs.yml'
11+
pull_request:
12+
paths:
13+
- 'docs/**'
14+
- '.github/workflows/docs.yml'
15+
16+
jobs:
17+
18+
build-docs:
19+
name: Build ReadTheDocs
20+
runs-on: ubuntu-latest
21+
defaults:
22+
run:
23+
shell: bash
24+
steps:
25+
- uses: actions/checkout@v2
26+
with:
27+
submodules: true
28+
- uses: actions/setup-python@v2
29+
with:
30+
python-version: '3.x'
31+
- name: Build
32+
run: |
33+
sudo apt update
34+
sudo apt install python3-pip python3-setuptools
35+
# GitHub CI installs pip3 and setuptools outside the path.
36+
# Update the path to include them and run.
37+
PATH=/home/runner/.local/bin:$PATH pip3 install --user -r ./docs/requirements.txt
38+
cd ./docs && PATH=/home/runner/.local/bin:$PATH SPHINXOPTS="-W" make html

.github/workflows/gh-pages.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
- pages
88
paths:
99
- 'README.md'
10-
- 'docs/**'
1110
- '.github/scripts/on-pages.sh'
1211
- '.github/workflows/gh-pages.yml'
1312

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ tools/esptool
66
tools/esptool.exe
77
tools/mkspiffs
88
tools/mklittlefs
9+
tools/mkfatfs.exe
910
.DS_Store
1011

1112
#Ignore files built by Visual Studio/Visual Micro
@@ -17,4 +18,6 @@ __vm/
1718
.vscode/
1819
platform.sloeber.txt
1920
boards.sloeber.txt
20-
tools/mklittlefs
21+
22+
# Ignore docs build (Sphinx)
23+
docs/build

CMakeLists.txt

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ set(CORE_SRCS
3434
cores/esp32/StreamString.cpp
3535
cores/esp32/USB.cpp
3636
cores/esp32/USBCDC.cpp
37+
cores/esp32/USBMSC.cpp
38+
cores/esp32/FirmwareMSC.cpp
39+
cores/esp32/firmware_msc_fat.c
3740
cores/esp32/wiring_pulse.c
3841
cores/esp32/wiring_shift.c
3942
cores/esp32/WMath.cpp
@@ -55,7 +58,7 @@ set(LIBRARY_SRCS
5558
libraries/FS/src/vfs_api.cpp
5659
libraries/HTTPClient/src/HTTPClient.cpp
5760
libraries/HTTPUpdate/src/HTTPUpdate.cpp
58-
libraries/LITTLEFS/src/LITTLEFS.cpp
61+
libraries/LittleFS/src/LittleFS.cpp
5962
libraries/NetBIOS/src/NetBIOS.cpp
6063
libraries/Preferences/src/Preferences.cpp
6164
libraries/RainMaker/src/RMaker.cpp
@@ -73,6 +76,14 @@ set(LIBRARY_SRCS
7376
libraries/Ticker/src/Ticker.cpp
7477
libraries/Update/src/Updater.cpp
7578
libraries/Update/src/HttpsOTAUpdate.cpp
79+
libraries/USB/src/USBHID.cpp
80+
libraries/USB/src/USBHIDMouse.cpp
81+
libraries/USB/src/USBHIDKeyboard.cpp
82+
libraries/USB/src/USBHIDGamepad.cpp
83+
libraries/USB/src/USBHIDConsumerControl.cpp
84+
libraries/USB/src/USBHIDSystemControl.cpp
85+
libraries/USB/src/USBHIDVendor.cpp
86+
libraries/USB/src/USBVendor.cpp
7687
libraries/WebServer/src/WebServer.cpp
7788
libraries/WebServer/src/Parsing.cpp
7889
libraries/WebServer/src/detail/mimetable.cpp
@@ -140,7 +151,7 @@ set(includedirs
140151
libraries/FS/src
141152
libraries/HTTPClient/src
142153
libraries/HTTPUpdate/src
143-
libraries/LITTLEFS/src
154+
libraries/LittleFS/src
144155
libraries/NetBIOS/src
145156
libraries/Preferences/src
146157
libraries/RainMaker/src
@@ -151,6 +162,7 @@ set(includedirs
151162
libraries/SPI/src
152163
libraries/Ticker/src
153164
libraries/Update/src
165+
libraries/USB/src
154166
libraries/WebServer/src
155167
libraries/WiFiClientSecure/src
156168
libraries/WiFi/src
@@ -161,25 +173,50 @@ set(includedirs
161173
set(srcs ${CORE_SRCS} ${LIBRARY_SRCS} ${BLE_SRCS})
162174
set(priv_includes cores/esp32/libb64)
163175
set(requires spi_flash mbedtls mdns esp_adc_cal wifi_provisioning nghttp)
164-
set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl bt main)
176+
set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl bt esp_ipc)
165177

178+
idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})
179+
180+
string(TOUPPER ${CONFIG_IDF_TARGET} idf_target_caps)
181+
target_compile_options(${COMPONENT_TARGET} PUBLIC
182+
-DARDUINO=10812
183+
-DARDUINO_${idf_target_caps}_DEV
184+
-DARDUINO_ARCH_ESP32
185+
-DARDUINO_BOARD="${idf_target_caps}_DEV"
186+
-DARDUINO_VARIANT="${CONFIG_IDF_TARGET}"
187+
-DESP32)
188+
189+
if(CONFIG_AUTOSTART_ARDUINO)
190+
# in autostart mode, arduino-esp32 contains app_main() function and needs to
191+
# reference setup() and loop() in the main component. If we add main
192+
# component to priv_requires then we create a large circular dependency
193+
# (arduino-esp32 -> main -> arduino-esp32) and can get linker errors, so
194+
# instead we add setup() and loop() to the undefined symbols list so the
195+
# linker will always include them.
196+
#
197+
# (As they are C++ symbol, we need to add the C++ mangled names.)
198+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u _Z5setupv -u _Z4loopv")
199+
endif()
200+
201+
# This function adds a dependency on the given component if the component is included into the build.
202+
function(maybe_add_component component_name)
203+
idf_build_get_property(components BUILD_COMPONENTS)
204+
if (${component_name} IN_LIST components)
205+
idf_component_get_property(lib_name ${component_name} COMPONENT_LIB)
206+
target_link_libraries(${COMPONENT_LIB} PUBLIC ${lib_name})
207+
endif()
208+
endfunction()
209+
210+
if(IDF_TARGET MATCHES "esp32" AND CONFIG_ESP_RMAKER_TASK_STACK)
211+
maybe_add_component(esp_rainmaker)
212+
maybe_add_component(qrcode)
213+
endif()
166214
if(IDF_TARGET MATCHES "esp32s2|esp32s3" AND CONFIG_TINYUSB_ENABLED)
167-
list(APPEND priv_requires arduino_tinyusb)
215+
maybe_add_component(arduino_tinyusb)
168216
endif()
169217
if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_ArduinoOTA)
170-
list(APPEND priv_requires esp_https_ota)
218+
maybe_add_component(esp_https_ota)
171219
endif()
172220
if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_LITTLEFS)
173-
if(CONFIG_LITTLEFS_PAGE_SIZE)
174-
list(APPEND priv_requires esp_littlefs)
175-
endif()
176-
endif()
177-
178-
idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})
179-
180-
if(IDF_TARGET STREQUAL "esp32")
181-
target_compile_options(${COMPONENT_TARGET} PUBLIC -DARDUINO=10812 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="ESP32_DEV" -DARDUINO_VARIANT="esp32" -DESP32)
182-
endif()
183-
if(IDF_TARGET STREQUAL "esp32s2")
184-
target_compile_options(${COMPONENT_TARGET} PUBLIC -DARDUINO=10812 -DARDUINO_ESP32S2_DEV -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="ESP32S2_DEV" -DARDUINO_VARIANT="esp32s2" -DESP32)
221+
maybe_add_component(esp_littlefs)
185222
endif()

0 commit comments

Comments
 (0)