Skip to content

Commit 60e4391

Browse files
authored
feat: Add PlatformIO support to devcontainer and Makefile (#133)
Refactors devcontainer to use a Dockerfile with pre-installed PlatformIO dependencies (platformio, intelhex, python3-pip). Adds a 'setup-pio' target to Makefile for host setup.
1 parent bcf8621 commit 60e4391

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.devcontainer/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM mcr.microsoft.com/devcontainers/base:jammy
2+
3+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
4+
&& apt-get -y install --no-install-recommends \
5+
python3-pip \
6+
python3-venv \
7+
udev \
8+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
9+
10+
RUN pip3 install -U platformio intelhex

.devcontainer/devcontainer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "Arduino & C++ Development",
3-
"image": "mcr.microsoft.com/devcontainers/base:jammy",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
47
"workspaceFolder": "/workspaces/StepperDriver",
58
"mounts": [
69
{
@@ -22,13 +25,15 @@
2225
"ms-vscode.cpptools",
2326
"ms-vscode.cpptools-themes",
2427
"vsciot-vscode.vscode-arduino",
25-
"eamodio.gitlens"
28+
"eamodio.gitlens",
29+
"platformio.platformio-ide"
2630
],
2731
"mcp": {
2832
"servers": {}
2933
}
3034
}
3135
},
36+
3237
"postCreateCommand": "sudo chown vscode /workspaces/StepperDriver/.arduino && make setup",
3338
"remoteUser": "vscode"
3439
}

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,7 @@ setup: $(ARDUINO_DIR)/arduino-cli
6060
$(ARDUINO_CLI) core update-index
6161
$(ARDUINO_CLI) core list
6262

63-
.PHONY: clean %.hex all setup
63+
setup-pio: # Install PlatformIO and dependencies
64+
pip3 install -U platformio intelhex
65+
66+
.PHONY: clean %.hex all setup setup-pio

0 commit comments

Comments
 (0)