xiao_serial_dfu.sh: take a board name from the local config, not only a serial

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-13 16:33:29 +01:00
1 parent 81d7f600d8
commit c93f5d906d
1 file changed
+4 -1
+4 -1
View File
@@ -7,7 +7,8 @@
#
# firmware.zip the DFU package (.pio/build/<env>/firmware.zip, or a release
# asset *.zip)
# usb-serial the board's USB serial number (matched in /dev/serial/by-id)
# usb-serial the board's USB serial number (matched in /dev/serial/by-id),
# or its name/alias in the local config
# board its name for serial_cli.py (local config, tools/mctools_config.py)
#
# NRF=<dir> directory holding tool-adafruit-nrfutil
@@ -34,6 +35,8 @@ esac
exit 2
}
ZIP=$1 SN=$2 BOARD=$3
# a board name/alias of the local config -> its USB serial; a serial passes through
SN="$(python3 "$(dirname "$0")/mctools_config.py" serial "$SN" 2>/dev/null || echo "$SN")"
WHY="$(python3 "$(dirname "$0")/mctools_config.py" get "$SN" refuse 2>/dev/null || true)"
[ -z "$WHY" ] || {
echo "refused: $WHY" >&2