初始化模板项目

This commit is contained in:
2025-03-27 16:53:15 +08:00
commit eb85c1046a
12 changed files with 357 additions and 0 deletions

17
.devcontainer/Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
FROM mcr.microsoft.com/devcontainers/base:dev-ubuntu-20.04
ENV DEBIAN_FRONTEND=noninteractive
# 安装基础依赖
RUN apt-get update && apt-get install -y \
python3 python3-pip python3-venv \
git curl build-essential && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# 安装 PlatformIO Core
RUN python3 -m pip install --upgrade platformio
WORKDIR /workspace

View File

@@ -0,0 +1,20 @@
{
"name": "Embedded DevContainer",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"remoteUser": "vscode",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools" // C/C++ 调试支持
],
"settings": {
"platformio-ide.useBuiltinPython": false, // 使用容器内 Python
"platformio-ide.customPATH": "/usr/local/bin"
}
}
},
"postCreateCommand": "platformio upgrade --dev && pio init && echo '环境初始化完成'" // 初始化 PlatformIO
}