Skip to content

Commit 370f3de

Browse files
authored
Merge pull request #9 from tasmota/master
sync
2 parents f4f1c89 + 48fb4e4 commit 370f3de

File tree

2,049 files changed

+131901
-56879
lines changed

Some content is hidden

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

2,049 files changed

+131901
-56879
lines changed

Diff for: .github/PULL_REQUEST_TEMPLATE.md

+16
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.

Diff for: .github/scripts/install-platformio-esp32.sh

+30-6
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..."

Diff for: .github/scripts/on-pages.sh

+53-47
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!"

Diff for: .github/workflows/docs.yml

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

Diff for: .github/workflows/gh-pages.yml

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

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ __vm/
1818
.vscode/
1919
platform.sloeber.txt
2020
boards.sloeber.txt
21+
22+
# Ignore docs build (Sphinx)
23+
docs/build

Diff for: CMakeLists.txt

+55-17
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ set(CORE_SRCS
3232
cores/esp32/stdlib_noniso.c
3333
cores/esp32/Stream.cpp
3434
cores/esp32/StreamString.cpp
35+
cores/esp32/HWCDC.cpp
3536
cores/esp32/USB.cpp
3637
cores/esp32/USBCDC.cpp
38+
cores/esp32/USBMSC.cpp
39+
cores/esp32/FirmwareMSC.cpp
40+
cores/esp32/firmware_msc_fat.c
3741
cores/esp32/wiring_pulse.c
3842
cores/esp32/wiring_shift.c
3943
cores/esp32/WMath.cpp
@@ -55,7 +59,7 @@ set(LIBRARY_SRCS
5559
libraries/FS/src/vfs_api.cpp
5660
libraries/HTTPClient/src/HTTPClient.cpp
5761
libraries/HTTPUpdate/src/HTTPUpdate.cpp
58-
libraries/LITTLEFS/src/LITTLEFS.cpp
62+
libraries/LittleFS/src/LittleFS.cpp
5963
libraries/NetBIOS/src/NetBIOS.cpp
6064
libraries/Preferences/src/Preferences.cpp
6165
libraries/RainMaker/src/RMaker.cpp
@@ -73,6 +77,14 @@ set(LIBRARY_SRCS
7377
libraries/Ticker/src/Ticker.cpp
7478
libraries/Update/src/Updater.cpp
7579
libraries/Update/src/HttpsOTAUpdate.cpp
80+
libraries/USB/src/USBHID.cpp
81+
libraries/USB/src/USBHIDMouse.cpp
82+
libraries/USB/src/USBHIDKeyboard.cpp
83+
libraries/USB/src/USBHIDGamepad.cpp
84+
libraries/USB/src/USBHIDConsumerControl.cpp
85+
libraries/USB/src/USBHIDSystemControl.cpp
86+
libraries/USB/src/USBHIDVendor.cpp
87+
libraries/USB/src/USBVendor.cpp
7688
libraries/WebServer/src/WebServer.cpp
7789
libraries/WebServer/src/Parsing.cpp
7890
libraries/WebServer/src/detail/mimetable.cpp
@@ -140,7 +152,7 @@ set(includedirs
140152
libraries/FS/src
141153
libraries/HTTPClient/src
142154
libraries/HTTPUpdate/src
143-
libraries/LITTLEFS/src
155+
libraries/LittleFS/src
144156
libraries/NetBIOS/src
145157
libraries/Preferences/src
146158
libraries/RainMaker/src
@@ -151,6 +163,7 @@ set(includedirs
151163
libraries/SPI/src
152164
libraries/Ticker/src
153165
libraries/Update/src
166+
libraries/USB/src
154167
libraries/WebServer/src
155168
libraries/WiFiClientSecure/src
156169
libraries/WiFi/src
@@ -161,25 +174,50 @@ set(includedirs
161174
set(srcs ${CORE_SRCS} ${LIBRARY_SRCS} ${BLE_SRCS})
162175
set(priv_includes cores/esp32/libb64)
163176
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)
177+
set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl bt esp_ipc esp_hid)
165178

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

0 commit comments

Comments
 (0)