Skip to content

Commit ceeeb45

Browse files
authored
Update build_uf2.yml
1 parent c9dffaf commit ceeeb45

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

.github/workflows/build_uf2.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,30 +76,27 @@ jobs:
7676
arduino-cli lib update-index
7777
echo "Installing required libraries..."
7878
arduino-cli lib install MIDIUSB
79-
arduino-cli lib install "Adafruit FreeTouch"
79+
arduino-cli lib install Adafruit_FreeTouch # <--- CHANGED THIS LINE
8080
arduino-cli lib install FlashStorage
8181
echo "Library installation complete."
8282
83-
- name: Set Hardware Define in Header # <--- RENAMED STEP TITLE
83+
- name: Set Hardware Define in Header
8484
env:
85-
CONFIG_FILE: "config.h" # <--- CHANGED TO config.h
85+
CONFIG_FILE: "config.h"
8686
CONFIG_DEFINE: ${{ matrix.hw_define }}
8787
DEFINES_LIST: "V1_PCB V1_2_PCB V2_ADVANCED_PCB NO_PCB_GITHUB_SPECS"
8888
run: |
8989
echo "Setting Hardware Define to: ${CONFIG_DEFINE} in ${CONFIG_FILE}"
9090
91-
# Check if config.h exists
9291
if [ ! -f "$CONFIG_FILE" ]; then
9392
echo "Error: $CONFIG_FILE not found!"
9493
exit 1
9594
fi
9695
97-
# First, ensure all target defines are commented out
9896
for DEF in $DEFINES_LIST; do
9997
sed -i -E "s|^(\s*#define\s+${DEF})|//#define ${DEF}|" $CONFIG_FILE
10098
done
10199
102-
# Now, uncomment only the desired define
103100
sed -i -E "s|^(\s*//\s*#define\s+${CONFIG_DEFINE})|#define ${CONFIG_DEFINE}|" $CONFIG_FILE
104101
105102
echo "--- Config File ($CONFIG_FILE) after modification ---"
@@ -108,9 +105,8 @@ jobs:
108105
109106
- name: Compile Sketch
110107
env:
111-
SKETCH_DIR: "." # Assuming firmware.ino and config.h are in the root.
108+
SKETCH_DIR: "."
112109
run: |
113-
# We still compile the directory containing firmware.ino
114110
arduino-cli compile --fqbn ${{ matrix.fqbn }} --output-dir build_output --export-binaries $SKETCH_DIR
115111
116112
- name: Find uf2conv.py
@@ -134,9 +130,9 @@ jobs:
134130
135131
- name: Convert to UF2
136132
env:
137-
SKETCH_NAME: "firmware" # Your sketch name without .ino
138-
UF2_FAMILY_ID: "0x68ED2B88" # Common for SAMD21 - VERIFY if needed
139-
UF2_BASE_ADDR: "0x2000" # Common for SAMD21 - VERIFY if needed
133+
SKETCH_NAME: "firmware"
134+
UF2_FAMILY_ID: "0x68ED2B88"
135+
UF2_BASE_ADDR: "0x2000"
140136
run: |
141137
BIN_FILE="build_output/${SKETCH_NAME}.ino.bin"
142138
echo "Converting $BIN_FILE to ${{ matrix.uf2_name }}"

0 commit comments

Comments
 (0)