修复四个关键bug: dest_fps限速/底行越界/255应为-1/删除debug文件重载

This commit is contained in:
spdis
2026-06-13 14:00:34 +08:00
parent d1e2234a43
commit d251f08670
4 changed files with 78 additions and 13 deletions
+53
View File
@@ -0,0 +1,53 @@
#!/bin/bash
# pack_code.sh — 将所有代码源文件打包为单个 txt
# 用法: bash pack_code.sh [输出文件名]
# 默认输出: smartcar2_code.txt
OUT="${1:-smartcar2_code.txt}"
> "$OUT"
# 分隔符
sep() { echo "" >> "$OUT"; echo "============================================================" >> "$OUT"; }
# 逐个追入,带文件路径头
append_file() {
local f="$1"
if [ ! -f "$f" ]; then return; fi
sep
echo "// FILE: $f" >> "$OUT"
sep
cat "$f" >> "$OUT"
}
# ── src/ 源文件 ──
for f in src/*.cpp src/*.hpp; do
[ -f "$f" ] && append_file "$f"
done
# ── lib/ 头文件 ──
for f in lib/*.h; do
[ -f "$f" ] && append_file "$f"
done
# ── main/ ──
append_file main/main.cpp
append_file main/CMakeLists.txt
# ── 顶层构建/配置 ──
append_file CMakeLists.txt
append_file cross.cmake
append_file ctl.sh
append_file start.sh
append_file .gitignore
# ── 独立 demo ──
append_file encoder_brake_demo.cpp
# ── 统计 ──
LINES=$(wc -l < "$OUT")
FILES=$(grep -c "// FILE:" "$OUT")
echo ""
echo "=== 打包完成 ==="
echo " 输出: $OUT"
echo " 文件数: $FILES"
echo " 总行数: $LINES"