Skip to content

Commit c5d2b1d

Browse files
authored
Merge branch 'espressif:master' into master
2 parents 7504957 + c369dca commit c5d2b1d

File tree

263 files changed

+16116
-1272
lines changed

Some content is hidden

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

263 files changed

+16116
-1272
lines changed

.github/CODEOWNERS

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# CODEOWNERS for ESP32 Arduino Core
2+
3+
# This file is used to specify the code owners for the ESP32 Arduino Core.
4+
# Read more about CODEOWNERS:
5+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
6+
# Note that order matters. The last matching pattern will be used.
7+
8+
# The default owners are the active developers of the ESP32 Arduino Core.
9+
# Refrain from using @espressif/arduino-esp32 to avoid spamming non-developers with review requests.
10+
* @espressif/arduino-devs
11+
12+
# CI
13+
/.github/ @lucasssvaz @me-no-dev @P-R-O-C-H-Y
14+
/.gitlab/ @lucasssvaz
15+
/tests/ @lucasssvaz @P-R-O-C-H-Y
16+
17+
# Tools
18+
/tools/ @me-no-dev
19+
/tools/pre-commit/ @lucasssvaz
20+
/tools/add_lib.sh @P-R-O-C-H-Y
21+
22+
# Pre-commit
23+
/.* @lucasssvaz # Files in root directory that start with a dot.
24+
25+
# Git Files
26+
/.gitignore @espressif/arduino-devs
27+
/.gitmodules @espressif/arduino-devs
28+
29+
# Documentation
30+
/docs/ @pedrominatel
31+
/.github/ISSUE_TEMPLATE/ @pedrominatel
32+
/.github/PULL_REQUEST_TEMPLATE.md @pedrominatel
33+
/.readthedocs.yaml @pedrominatel
34+
/*.md @pedrominatel
35+
36+
# Boards
37+
/variants/ @P-R-O-C-H-Y
38+
/boards.txt @P-R-O-C-H-Y
39+
40+
# Arduino as Component
41+
/idf_component_examples/ @SuGlider
42+
/idf_component.yml @SuGlider @me-no-dev
43+
/CMakeLists.txt @SuGlider @me-no-dev
44+
/Kconfig.projbuild @SuGlider @me-no-dev
45+
46+
# Build System
47+
/package.json @me-no-dev
48+
/platform.txt @me-no-dev
49+
/programmers.txt @me-no-dev
50+
/package/ @me-no-dev
51+
52+
# Libraries
53+
/libraries/ArduinoOTA/ @me-no-dev
54+
/libraries/AsyncUDP/ @me-no-dev
55+
/libraries/BLE/ @lucasssvaz @SuGlider
56+
/libraries/ESP_I2S/ @me-no-dev
57+
/libraries/ESP_NOW/ @P-R-O-C-H-Y @lucasssvaz
58+
/libraries/ESP_SR/ @me-no-dev
59+
/libraries/ESPmDNS/ @me-no-dev
60+
/libraries/Ethernet/ @me-no-dev
61+
/libraries/Matter/ @SuGlider
62+
/libraries/NetBIOS/ @me-no-dev
63+
/libraries/Network/ @me-no-dev
64+
/libraries/OpenThread/ @SuGlider
65+
/libraries/PPP/ @me-no-dev
66+
/libraries/SPI/ @me-no-dev
67+
/libraries/Update/ @me-no-dev
68+
/libraries/USB/ @SuGlider @me-no-dev
69+
/libraries/WiFi/ @me-no-dev
70+
/libraries/WiFiProv/ @me-no-dev
71+
/libraries/Wire/ @me-no-dev
72+
/libraries/Zigbee/ @P-R-O-C-H-Y
73+
74+
# CI JSON
75+
# Keep this after other libraries and tests to avoid being overridden.
76+
**/ci.json @lucasssvaz
77+
78+
# The CODEOWNERS file should be owned by the developers of the ESP32 Arduino Core.
79+
# Leave this entry as the last one to avoid being overridden.
80+
/.github/CODEOWNERS @espressif/arduino-devs

.github/ISSUE_TEMPLATE/Issue-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ body:
4343
- latest stable Release (if not listed below)
4444
- latest development Release Candidate (RC-X)
4545
- latest master (checkout manually)
46+
- v3.2.1
4647
- v3.2.0
4748
- v3.1.3
4849
- v3.1.2

.github/scripts/merge_packages.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Usage:
55
# python merge_packages.py package_esp8266com_index.json version/new/package_esp8266com_index.json
66
# Written by Ivan Grokhotkov, 2015
7+
# Updated by lucasssvaz to handle Chinese version sorting, 2025
78
#
89

910
from __future__ import print_function
@@ -36,20 +37,19 @@ def merge_objects(versions, obj):
3637

3738

3839
# Normalize ESP release version string (x.x.x) by adding '-rc<MAXINT>' (x.x.x-rc9223372036854775807)
39-
# to ensure having REL above any RC
40+
# to ensure having REL above any RC. CN version will be sorted after the official version if they happen
41+
# to be mixed (normally, CN and non-CN versions should not be mixed)
4042
# Dummy approach, functional anyway for current ESP package versioning
4143
# (unlike NormalizedVersion/LooseVersion/StrictVersion & similar crap)
4244
def pkgVersionNormalized(versionString):
43-
44-
verStr = str(versionString)
45+
verStr = str(versionString).replace("-cn", "")
4546
verParts = re.split(r"\.|-rc|-alpha", verStr, flags=re.IGNORECASE)
4647

4748
if len(verParts) == 3:
48-
if sys.version_info > (3, 0): # Python 3
49-
verStr = str(versionString) + "-rc" + str(sys.maxsize)
50-
else: # Python 2
51-
verStr = str(versionString) + "-rc" + str(sys.maxint)
52-
49+
if "-cn" in str(versionString):
50+
verStr = verStr + "-rc" + str(sys.maxsize // 2)
51+
else:
52+
verStr = verStr + "-rc" + str(sys.maxsize)
5353
elif len(verParts) != 4:
5454
print("pkgVersionNormalized WARNING: unexpected version format: {0})".format(verStr), file=sys.stderr)
5555

.github/scripts/on-release.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,14 @@ jq_arg=".packages[0].platforms[0].version = \"$RELEASE_TAG\" | \
342342
echo "Generating $PACKAGE_JSON_DEV ..."
343343
cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV"
344344
# On MacOS the sed command won't skip the first match. Use gsed instead.
345-
sed '0,/github\.com\/espressif\//!s|github\.com/espressif/|dl.espressif.cn/github_assets/espressif/|g' "$OUTPUT_DIR/$PACKAGE_JSON_DEV" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN"
345+
sed '0,/github\.com\//!s|github\.com/|dl.espressif.cn/github_assets/|g' "$OUTPUT_DIR/$PACKAGE_JSON_DEV" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN"
346+
python "$SCRIPTS_DIR/release_append_cn.py" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN"
346347
if [ "$RELEASE_PRE" == "false" ]; then
347348
echo "Generating $PACKAGE_JSON_REL ..."
348349
cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_REL"
349350
# On MacOS the sed command won't skip the first match. Use gsed instead.
350-
sed '0,/github\.com\/espressif\//!s|github\.com/espressif/|dl.espressif.cn/github_assets/espressif/|g' "$OUTPUT_DIR/$PACKAGE_JSON_REL" > "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN"
351+
sed '0,/github\.com\//!s|github\.com/|dl.espressif.cn/github_assets/|g' "$OUTPUT_DIR/$PACKAGE_JSON_REL" > "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN"
352+
python "$SCRIPTS_DIR/release_append_cn.py" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN"
351353
fi
352354

353355
# Figure out the last release or pre-release
@@ -456,14 +458,14 @@ echo "Uploading $PACKAGE_JSON_DEV ..."
456458
echo "Download URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV")"
457459
echo "Pages URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV")"
458460
echo "Download CN URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")"
459-
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")"
461+
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV_CN" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")"
460462
echo
461463
if [ "$RELEASE_PRE" == "false" ]; then
462464
echo "Uploading $PACKAGE_JSON_REL ..."
463465
echo "Download URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL")"
464466
echo "Pages URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL")"
465467
echo "Download CN URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")"
466-
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")"
468+
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL_CN" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")"
467469
echo
468470
fi
469471

.github/scripts/release_append_cn.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
#!/usr/bin/env python3
3+
4+
# Arduino IDE provides by default a package file for the ESP32. This causes version conflicts
5+
# when the user tries to use the JSON file with the Chinese mirrors.
6+
#
7+
# The downside is that the Arduino IDE will always warn the user that updates are available as it
8+
# will consider the version from the Chinese mirrors as a pre-release version.
9+
#
10+
# This script is used to append "-cn" to all versions in the package_esp32_index_cn.json file so that
11+
# the user can select the Chinese mirrors without conflicts.
12+
#
13+
# If Arduino ever stops providing the package_esp32_index.json file by default,
14+
# this script can be removed and the tags reverted.
15+
16+
import json
17+
18+
def append_cn_to_versions(obj):
19+
if isinstance(obj, dict):
20+
# Skip tools that are not from the esp32 package
21+
packager = obj.get("packager")
22+
if packager is not None and packager != "esp32":
23+
return
24+
25+
for key, value in obj.items():
26+
if key == "version" and isinstance(value, str):
27+
if not value.endswith("-cn"):
28+
obj[key] = value + "-cn"
29+
else:
30+
append_cn_to_versions(value)
31+
32+
elif isinstance(obj, list):
33+
for item in obj:
34+
append_cn_to_versions(item)
35+
36+
def process_json_file(input_path, output_path=None):
37+
with open(input_path, "r", encoding="utf-8") as f:
38+
data = json.load(f)
39+
40+
append_cn_to_versions(data)
41+
42+
if output_path is None:
43+
output_path = input_path
44+
45+
with open(output_path, "w", encoding="utf-8") as f:
46+
json.dump(data, f, indent=2)
47+
48+
print(f"Updated JSON written to {output_path}")
49+
50+
if __name__ == "__main__":
51+
import sys
52+
if len(sys.argv) < 2:
53+
print("Usage: python release_append_cn.py input.json [output.json]")
54+
else:
55+
input_file = sys.argv[1]
56+
output_file = sys.argv[2] if len(sys.argv) > 2 else None
57+
process_json_file(input_file, output_file)

.github/scripts/update-version.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
# Disable shellcheck warning about using 'cat' to read a file.
23
# shellcheck disable=SC2002
34

45
# For reference: add tools for all boards by replacing one line in each board
@@ -23,14 +24,32 @@ ESP_ARDUINO_VERSION_MINOR="$2"
2324
ESP_ARDUINO_VERSION_PATCH="$3"
2425
ESP_ARDUINO_VERSION="$ESP_ARDUINO_VERSION_MAJOR.$ESP_ARDUINO_VERSION_MINOR.$ESP_ARDUINO_VERSION_PATCH"
2526

27+
# Get ESP-IDF version from push.yml (this way we can ensure that the version is correct even if the local libs are not up to date)
28+
ESP_IDF_VERSION=$(grep "idf_ver:" .github/workflows/push.yml | sed 's/.*release-v\([^"]*\).*/\1/')
29+
if [ -z "$ESP_IDF_VERSION" ]; then
30+
echo "Error: ESP-IDF version not found in push.yml" >&2
31+
exit 1
32+
fi
33+
2634
echo "New Arduino Version: $ESP_ARDUINO_VERSION"
35+
echo "ESP-IDF Version: $ESP_IDF_VERSION"
2736

2837
echo "Updating platform.txt..."
2938
cat platform.txt | sed "s/version=.*/version=$ESP_ARDUINO_VERSION/g" > __platform.txt && mv __platform.txt platform.txt
3039

3140
echo "Updating package.json..."
3241
cat package.json | sed "s/.*\"version\":.*/ \"version\": \"$ESP_ARDUINO_VERSION\",/g" > __package.json && mv __package.json package.json
3342

43+
echo "Updating docs/conf_common.py..."
44+
cat docs/conf_common.py | \
45+
sed "s/.. |version| replace:: .*/.. |version| replace:: $ESP_ARDUINO_VERSION/g" | \
46+
sed "s/.. |idf_version| replace:: .*/.. |idf_version| replace:: $ESP_IDF_VERSION/g" > docs/__conf_common.py && mv docs/__conf_common.py docs/conf_common.py
47+
48+
echo "Updating .gitlab/workflows/common.yml..."
49+
cat .gitlab/workflows/common.yml | \
50+
sed "s/ESP_IDF_VERSION:.*/ESP_IDF_VERSION: \"$ESP_IDF_VERSION\"/g" | \
51+
sed "s/ESP_ARDUINO_VERSION:.*/ESP_ARDUINO_VERSION: \"$ESP_ARDUINO_VERSION\"/g" > .gitlab/workflows/__common.yml && mv .gitlab/workflows/__common.yml .gitlab/workflows/common.yml
52+
3453
echo "Updating cores/esp32/esp_arduino_version.h..."
3554
cat cores/esp32/esp_arduino_version.h | \
3655
sed "s/#define ESP_ARDUINO_VERSION_MAJOR.*/#define ESP_ARDUINO_VERSION_MAJOR $ESP_ARDUINO_VERSION_MAJOR/g" | \

0 commit comments

Comments
 (0)