Files
zwx b88e4b76e0 update libphy for track and 154 api
* S31 phy_version: 101, 7b1f880, Sep  2 2026
2026-09-07 15:06:44 +08:00

39 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
for dir in */; do
dir=${dir%/}
if [ $dir = esp32 ]; then
TOOLCHAIN="xtensa-esp32-elf"
elif [ $dir = esp32s2 ]; then
TOOLCHAIN="xtensa-esp32s2-elf"
elif [ $dir = esp32s3 ]; then
TOOLCHAIN="xtensa-esp32s3-elf"
else
TOOLCHAIN="riscv32-esp-elf"
fi
if [ -d "$dir" ]; then
cd "$dir" || continue
for lib in *.a; do
echo $dir/$lib
if [ "$lib" = "librtc.a" ]; then
git status "$lib" | grep -E "modified|new file" >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo "$dir/$lib fixed"
$TOOLCHAIN-objcopy --redefine-sym ets_printf=rtc_printf "$lib"
fi
continue
fi
git status "$lib" | grep -E "modified|new file" >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo "$dir/$lib fixed"
$TOOLCHAIN-objcopy --redefine-sym ets_printf=phy_printf "$lib"
fi
done
cd ..
else
echo "$dir does not exist"
fi
done