1 Star 1 Fork 0

ぃ氵番、剑虹 、 / itlwm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
fw_gen.sh 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
zxystd 提交于 2020-05-16 18:02 . update project config
#!/bin/sh
# fw_gen.sh
# itlwm
#
# Created by qcwap on 2020/3/10.
# Copyright © 2020 钟先耀. All rights reserved.
target_file="${PROJECT_DIR}/itlwm/FwBinary.cpp"
fw_files=${PROJECT_DIR}/itlwm/firmware/*
echo "// itlwm\n\n// Copyright © 2020 钟先耀. All rights reserved." >$target_file
echo "#include \"FwData.h\"">>$target_file
for fw in $fw_files; do
fw_file_name=`basename $fw`
fw_var_name=${fw_file_name//./_}
fw_var_name=${fw_var_name//-/_}
echo "">>$target_file
echo "const unsigned char ${fw_var_name}[] = {">>$target_file
xxd -i <$fw >>$target_file
echo "};">>$target_file
echo "">>$target_file
echo "const long int ${fw_var_name}_size = sizeof(${fw_var_name});">>$target_file
done
echo "">>$target_file
echo "const struct FwDesc fwList[] = {">>$target_file
i=0;
for fw in $fw_files; do
fw_file_name=`basename $fw`
fw_var_name=${fw_file_name//./_}
fw_var_name=${fw_var_name//-/_}
echo "{IWL_FW(\"$fw_file_name\", $fw_var_name, ${fw_var_name}_size)},">>$target_file
let i+=1
done
echo "};">>$target_file
echo "const int fwNumber = $i;">>$target_file
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/isx/itlwm.git
git@gitee.com:isx/itlwm.git
isx
itlwm
itlwm
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891