Skip to content

Commit a98c031

Browse files
Merge remote-tracking branch 'origin/master' into feat/support_rakwireless_rak3112
2 parents a8620bc + 2592a7b commit a98c031

File tree

85 files changed

+2771
-579
lines changed

Some content is hidden

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

85 files changed

+2771
-579
lines changed

.github/scripts/package_esptool.sh

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
# Check version argument
6+
if [[ $# -ne 3 ]]; then
7+
echo "Usage: $0 <version> <base_folder> <json_path>"
8+
echo "Example: $0 5.0.dev1 /tmp/esptool /tmp/esptool-5.0.dev1.json"
9+
exit 1
10+
fi
11+
12+
VERSION=$1
13+
BASE_FOLDER=$2
14+
JSON_PATH=$3
15+
16+
export COPYFILE_DISABLE=1
17+
18+
shopt -s nullglob # So for loop doesn't run if no matches
19+
20+
# Function to update JSON for a given host
21+
function update_json_for_host {
22+
local host=$1
23+
local archive=$2
24+
25+
# Extract the old url from the JSON for this host, then replace only the filename
26+
old_url=$(jq -r --arg host "$host" '
27+
.packages[].tools[] | select(.name == "esptool_py") | .systems[] | select(.host == $host) | .url // empty
28+
' "$tmp_json")
29+
if [[ -n "$old_url" ]]; then
30+
base_url="${old_url%/*}"
31+
url="$base_url/$archive"
32+
else
33+
echo "No old url found for $host"
34+
exit 1
35+
fi
36+
37+
archiveFileName="$archive"
38+
checksum="SHA-256:$(shasum -a 256 "$archive" | awk '{print $1}')"
39+
size=$(stat -f%z "$archive")
40+
41+
# Use jq to update the JSON
42+
jq --arg host "$host" \
43+
--arg url "$url" \
44+
--arg archiveFileName "$archiveFileName" \
45+
--arg checksum "$checksum" \
46+
--arg size "$size" \
47+
'
48+
.packages[].tools[]
49+
|= if .name == "esptool_py" then
50+
.systems = (
51+
((.systems // []) | map(select(.host != $host))) + [{
52+
host: $host,
53+
url: $url,
54+
archiveFileName: $archiveFileName,
55+
checksum: $checksum,
56+
size: $size
57+
}]
58+
)
59+
else
60+
.
61+
end
62+
' "$tmp_json" > "$tmp_json.new" && mv "$tmp_json.new" "$tmp_json"
63+
}
64+
65+
cd "$BASE_FOLDER"
66+
67+
# Delete all archives before starting
68+
rm -f esptool-*.tar.gz esptool-*.zip
69+
70+
for dir in esptool-*; do
71+
# Check if directory exists and is a directory
72+
if [[ ! -d "$dir" ]]; then
73+
continue
74+
fi
75+
76+
base="${dir#esptool-}"
77+
78+
# Add 'linux-' prefix if base doesn't contain linux/macos/win64
79+
if [[ "$base" != *linux* && "$base" != *macos* && "$base" != *win64* ]]; then
80+
base="linux-${base}"
81+
fi
82+
83+
if [[ "$dir" == esptool-win* ]]; then
84+
# Windows zip archive
85+
zipfile="esptool-v${VERSION}-${base}.zip"
86+
echo "Creating $zipfile from $dir ..."
87+
zip -r "$zipfile" "$dir"
88+
else
89+
# Non-Windows: set permissions and tar.gz archive
90+
tarfile="esptool-v${VERSION}-${base}.tar.gz"
91+
echo "Setting permissions and creating $tarfile from $dir ..."
92+
chmod -R u=rwx,g=rx,o=rx "$dir"
93+
tar -cvzf "$tarfile" "$dir"
94+
fi
95+
done
96+
97+
# After the for loop, update the JSON for each archive
98+
# Create a temporary JSON file to accumulate changes
99+
tmp_json="${JSON_PATH}.tmp"
100+
cp "$JSON_PATH" "$tmp_json"
101+
102+
for archive in esptool-v"${VERSION}"-*.tar.gz esptool-v"${VERSION}"-*.zip; do
103+
[ -f "$archive" ] || continue
104+
105+
echo "Updating JSON for $archive"
106+
107+
# Determine host from archive name
108+
case "$archive" in
109+
*linux-amd64*) host="x86_64-pc-linux-gnu" ;;
110+
*linux-armv7*) host="arm-linux-gnueabihf" ;;
111+
*linux-aarch64*) host="aarch64-linux-gnu" ;;
112+
*macos-amd64*) host="x86_64-apple-darwin" ;;
113+
*macos-arm64*) host="arm64-apple-darwin" ;;
114+
*win64*) hosts=("x86_64-mingw32" "i686-mingw32") ;;
115+
*) echo "Unknown host for $archive"; continue ;;
116+
esac
117+
118+
# For win64, loop over both hosts; otherwise, use a single host
119+
if [[ "$archive" == *win64* ]]; then
120+
for host in "${hosts[@]}"; do
121+
update_json_for_host "$host" "$archive"
122+
done
123+
else
124+
update_json_for_host "$host" "$archive"
125+
fi
126+
done
127+
128+
# After all archives are processed, move the temporary JSON to the final file
129+
mv "$tmp_json" "$JSON_PATH"

.github/workflows/lib.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
{
1010
"name": "ArduinoBLE",
1111
"exclude_targets": [
12-
"esp32s2"
12+
"esp32s2",
13+
"esp32p4"
1314
],
1415
"sketch_path": [
1516
"~/Arduino/libraries/ArduinoBLE/examples/Central/Scan/Scan.ino"

.github/workflows/publishsizes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
path: ./artifacts/sizes-report/pr_num.txt
6767

6868
- name: Report results
69-
uses: P-R-O-C-H-Y/report-size-deltas@2043188c68f483a7b50527c4eacf609d05bb67a5 # sizes_v2
69+
uses: P-R-O-C-H-Y/report-size-deltas@bea91d2c99ca80c88a883b39b1c4012f00ec3d09 # sizes_v2
7070
with:
7171
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
7272
github-token: ${{ env.GITHUB_TOKEN }}

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ set(ARDUINO_LIBRARY_LittleFS_SRCS libraries/LittleFS/src/LittleFS.cpp)
165165
set(ARDUINO_LIBRARY_NetBIOS_SRCS libraries/NetBIOS/src/NetBIOS.cpp)
166166

167167
set(ARDUINO_LIBRARY_OpenThread_SRCS
168+
libraries/OpenThread/src/OThread.cpp
168169
libraries/OpenThread/src/OThreadCLI.cpp
169170
libraries/OpenThread/src/OThreadCLI_Util.cpp)
170171

boards.txt

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36051,12 +36051,12 @@ XIAO_ESP32S3_Plus.build.cdc_on_boot=1
3605136051
XIAO_ESP32S3_Plus.build.msc_on_boot=0
3605236052
XIAO_ESP32S3_Plus.build.dfu_on_boot=0
3605336053
XIAO_ESP32S3_Plus.build.f_cpu=240000000L
36054-
XIAO_ESP32S3_Plus.build.flash_size=8MB
36054+
XIAO_ESP32S3_Plus.build.flash_size=16MB
3605536055
XIAO_ESP32S3_Plus.build.flash_freq=80m
3605636056
XIAO_ESP32S3_Plus.build.flash_mode=dio
3605736057
XIAO_ESP32S3_Plus.build.boot=qio
3605836058
XIAO_ESP32S3_Plus.build.boot_freq=80m
36059-
XIAO_ESP32S3_Plus.build.partitions=default_8MB
36059+
XIAO_ESP32S3_Plus.build.partitions=ffat
3606036060
XIAO_ESP32S3_Plus.build.defines=
3606136061
XIAO_ESP32S3_Plus.build.loop_core=
3606236062
XIAO_ESP32S3_Plus.build.event_core=
@@ -36093,8 +36093,6 @@ XIAO_ESP32S3_Plus.menu.FlashMode.dio.build.boot=dio
3609336093
XIAO_ESP32S3_Plus.menu.FlashMode.dio.build.boot_freq=80m
3609436094
XIAO_ESP32S3_Plus.menu.FlashMode.dio.build.flash_freq=80m
3609536095

36096-
XIAO_ESP32S3_Plus.menu.FlashSize.8M=8MB (64Mb)
36097-
XIAO_ESP32S3_Plus.menu.FlashSize.8M.build.flash_size=8MB
3609836096
XIAO_ESP32S3_Plus.menu.FlashSize.16M=16MB (128Mb)
3609936097
XIAO_ESP32S3_Plus.menu.FlashSize.16M.build.flash_size=16MB
3610036098

@@ -50707,4 +50705,60 @@ rakwireless_rak3112.menu.EraseFlash.none.upload.erase_cmd=
5070750705
rakwireless_rak3112.menu.EraseFlash.all=Enabled
5070850706
rakwireless_rak3112.menu.EraseFlash.all.upload.erase_cmd=-e
5070950707

50710-
##############################################################
50708+
##############################################################
50709+
kodedot.name=kode dot
50710+
50711+
kodedot.bootloader.tool=esptool_py
50712+
kodedot.bootloader.tool.default=esptool_py
50713+
50714+
kodedot.upload.tool=esptool_py_app_only
50715+
kodedot.upload.tool.default=esptool_py_app_only
50716+
kodedot.upload.tool.network=esp_ota
50717+
50718+
kodedot.upload.maximum_size=8388608
50719+
kodedot.upload.maximum_data_size=327680
50720+
kodedot.upload.flags=
50721+
kodedot.upload.extra_flags=
50722+
kodedot.upload.use_1200bps_touch=false
50723+
kodedot.upload.wait_for_upload_port=false
50724+
kodedot.upload.speed=921600
50725+
50726+
kodedot.upload.erase_cmd=
50727+
50728+
kodedot.serial.disableDTR=false
50729+
kodedot.serial.disableRTS=false
50730+
50731+
kodedot.build.tarch=xtensa
50732+
kodedot.build.bootloader_addr=0x0
50733+
kodedot.build.target=esp32s3
50734+
kodedot.build.mcu=esp32s3
50735+
kodedot.build.core=esp32
50736+
kodedot.build.variant=kodedot
50737+
kodedot.build.board=KODE_DOT
50738+
50739+
kodedot.build.usb_mode=1
50740+
kodedot.build.cdc_on_boot=1
50741+
kodedot.build.msc_on_boot=0
50742+
kodedot.build.dfu_on_boot=0
50743+
50744+
kodedot.build.f_cpu=240000000L
50745+
50746+
kodedot.build.flash_offset=0x400000
50747+
kodedot.build.flash_size=16MB
50748+
kodedot.build.flash_freq=80m
50749+
kodedot.build.flash_mode=dio
50750+
50751+
kodedot.build.custom_partitions=kodedot_partitions
50752+
50753+
kodedot.build.psram_type=qspi
50754+
kodedot.build.defines=
50755+
50756+
kodedot.build.loop_core=-DARDUINO_RUNNING_CORE=1
50757+
kodedot.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1
50758+
50759+
kodedot.recipe.hooks.objcopy.postobjcopy.3.pattern=
50760+
kodedot.recipe.hooks.objcopy.postobjcopy.3.pattern_args=
50761+
50762+
kodedot.recipe.output.save_file={build.project_name}.ino.bin
50763+
50764+
##############################################################

cores/esp32/WString.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,15 @@ bool String::changeBuffer(unsigned int maxStrLen) {
180180
if (maxStrLen < sizeof(sso.buff) - 1) {
181181
if (isSSO() || !buffer()) {
182182
// Already using SSO, nothing to do
183-
uint16_t oldLen = len();
183+
size_t oldLen = len();
184184
setSSO(true);
185185
setLen(oldLen);
186186
} else { // if bufptr && !isSSO()
187187
// Using bufptr, need to shrink into sso.buff
188188
char temp[sizeof(sso.buff)];
189189
memcpy(temp, buffer(), maxStrLen);
190190
free(wbuffer());
191-
uint16_t oldLen = len();
191+
size_t oldLen = len();
192192
setSSO(true);
193193
memcpy(wbuffer(), temp, maxStrLen);
194194
setLen(oldLen);
@@ -201,7 +201,7 @@ bool String::changeBuffer(unsigned int maxStrLen) {
201201
if (newSize > CAPACITY_MAX) {
202202
return false;
203203
}
204-
uint16_t oldLen = len();
204+
size_t oldLen = len();
205205
char *newbuffer = (char *)realloc(isSSO() ? nullptr : wbuffer(), newSize);
206206
if (newbuffer) {
207207
size_t oldSize = capacity() + 1; // include NULL.

0 commit comments

Comments
 (0)