Dzbj_C3_Key/spi_lcd/idf_env.sh

33 lines
899 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# ESP-IDF环境变量设置脚本
# 用于解决esp-clang版本警告问题
# 保存原始PATH
ORIGINAL_PATH=$PATH
# 移除包含系统clang的路径通常是/usr/bin
# 这样ESP-IDF就不会检测到不支持的系统clang版本
MODIFIED_PATH=$(echo $PATH | tr ':' '\n' | grep -v '/usr/bin' | tr '\n' ':')
# 确保路径以冒号结尾
if [[ ! $MODIFIED_PATH =~ :$ ]]; then
MODIFIED_PATH="$MODIFIED_PATH:"
fi
# 导出修改后的PATH
export PATH=$MODIFIED_PATH
# 执行ESP-IDF的环境设置脚本
source /Users/rdzleo/esp/esp-idf/v5.4.2/esp-idf/export.sh
# 恢复原始PATH
export PATH=$ORIGINAL_PATH
# 输出提示信息
echo "ESP-IDF环境设置完成已解决esp-clang版本警告问题。"
echo "请使用以下命令运行ESP-IDF工具"
echo " ./run_idf_cmd.sh idf.py build"
echo " ./run_idf_cmd.sh idf.py flash"
echo " ./run_idf_cmd.sh idf.py monitor"