1.测试了电池adc的驱动,正常读出数据,且电压与万用表示一致,测试通过

2.增加了项目部署说明
3.修改了一件编译,烧录,监视脚本的内容以增加对监视输出日志的本地持久化,便于查找开发过程中的各种bug
This commit is contained in:
Misaki
2025-08-23 19:30:40 +08:00
parent 80cfbec7df
commit fec1a52093
11 changed files with 296 additions and 20 deletions
+14 -7
View File
@@ -1,18 +1,25 @@
#!/usr/bin/env zsh
### 本脚本实现了Linux下的esp idf的一键编译烧录与监视,并且监视具有交互能力
### Code by Misaki ---- 2025.8.22
### 本脚本实现了 Linux 下 ESP-IDF 的一键编译烧录与监视,
### 监视器内容会自动写入到脚本同目录 log/ 下的时间戳日志文件。
### Code by Misaki ---- 2025.8.22 (Modified 2025.8.23)
# 如果 idf.py 不在 PATH,请 source export.sh 或手动 export IDF_PATH/PATH
# 如果 idf.py 不在 PATH,请事先 source export.sh 或手动 export IDF_PATH/PATH
# source $HOME/Apps/esp/esp-idf/export.sh
set -e # 任何一步失败就退出
PORT=${1:-/dev/ttyACM0} # 允许外部传参,默认 /dev/ttyACM0
# 0) 准备日志目录与文件名
SCRIPT_DIR=${0:a:h} # zsh 取脚本所在绝对目录
LOG_DIR="$SCRIPT_DIR/log"
mkdir -p "$LOG_DIR" # 没有就自动创建
LOG_FILE="$LOG_DIR/$(date +%Y_%m_%d_%H_%M_%S).log"
# 1) 实时 build + flash
export PYTHONUNBUFFERED=1
idf.py -p "$PORT" build flash
# 2) 在外部 Konsole 打开 monitor (注意,这个地方要根据自己系统使用的终端来修改,我使用的是konsole + zsh
# --new-tab 在当前窗口新建标签页
# --hold monitor 退出后不自动关窗口
konsole --new-tab --hold -e zsh -c "idf.py -p $PORT monitor"
# 2) 在外部 Konsole 打开 monitor,同时把内容实时写入 $LOG_FILE
# tee -a 追加写入,--hold 让窗口在 monitor 退出后保留
konsole --new-tab --hold \
-e zsh -c "idf.py -p $PORT monitor 2>&1 | tee -a '$LOG_FILE'"