From fc5150df16383ae130d0520183488abdc8354488 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Tue, 17 Dec 2024 17:26:02 -0800 Subject: [PATCH] Build all 4 variants and archive them --- .github/workflows/build.yml | 38 ++++++++++++++++++++++++--- Software/GuitarPedal/Makefile | 11 ++++++++ Software/GuitarPedal/ci/build_app.sh | 5 ++-- Software/GuitarPedal/guitar_pedal.cpp | 5 +++- 4 files changed, 52 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 136e6c0..acea5a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,13 +20,43 @@ jobs: - name: Build Libraries working-directory: Software/GuitarPedal/ run: ./ci/build_libs.sh - - name: Build GuitarPedal firmware + - name: Build GuitarPedal firmware 125B working-directory: Software/GuitarPedal/ - run: ./ci/build_app.sh - - name: Archive 125b .bin + run: ./ci/build_app.sh VARIANT=125B + - name: Archive 125B .bin uses: actions/upload-artifact@v4 with: - name: 125b Firmware + name: 125B Firmware + path: | + Software/GuitarPedal/build/guitarpedal.bin + if-no-files-found: error + - name: Build GuitarPedal firmware Terrarium + working-directory: Software/GuitarPedal/ + run: ./ci/build_app.sh VARIANT=TERRARIUM + - name: Archive Terrarium .bin + uses: actions/upload-artifact@v4 + with: + name: Terrarium Firmware + path: | + Software/GuitarPedal/build/guitarpedal.bin + if-no-files-found: error + - name: Build GuitarPedal firmware 1590B + working-directory: Software/GuitarPedal/ + run: ./ci/build_app.sh VARIANT=1590B + - name: Archive 1590B .bin + uses: actions/upload-artifact@v4 + with: + name: 1590B Firmware + path: | + Software/GuitarPedal/build/guitarpedal.bin + if-no-files-found: error + - name: Build GuitarPedal firmware 1590B-SMT + working-directory: Software/GuitarPedal/ + run: ./ci/build_app.sh VARIANT=1590B_SMT + - name: Archive 1590B-SMT .bin + uses: actions/upload-artifact@v4 + with: + name: 1590B-SMT Firmware path: | Software/GuitarPedal/build/guitarpedal.bin if-no-files-found: error diff --git a/Software/GuitarPedal/Makefile b/Software/GuitarPedal/Makefile index 674ac64..2bc1cfb 100644 --- a/Software/GuitarPedal/Makefile +++ b/Software/GuitarPedal/Makefile @@ -23,3 +23,14 @@ SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core include $(SYSTEM_FILES_DIR)/Makefile C_INCLUDES += -I./q/q/q_lib/include -I./q/infra/include + +# Parse variants from argument to make, if none is supplied, will build for 125B +# options: +# make -j8 VARIANT=125B +# make -j8 VARIANT=1590B +# make -j8 VARIANT=1590B_SMD +# make -j8 VARIANT=TERRARIUM +ifdef VARIANT + CFLAGS += -DVARIANT_$(VARIANT) + $(info VARIANT=$(VARIANT)) +endif diff --git a/Software/GuitarPedal/ci/build_app.sh b/Software/GuitarPedal/ci/build_app.sh index 77f5787..ce9d0ef 100755 --- a/Software/GuitarPedal/ci/build_app.sh +++ b/Software/GuitarPedal/ci/build_app.sh @@ -1,7 +1,8 @@ #!/bin/bash -echo "building GuitarPedal firmware . . ." +echo "building GuitarPedal firmware..." +echo "arg: $1" make clean -make -j 4 +make -j 4 $1 if [ $? -ne 0 ]; then echo "Failed to compile GuitarPedal firmware" exit 1 diff --git a/Software/GuitarPedal/guitar_pedal.cpp b/Software/GuitarPedal/guitar_pedal.cpp index 2749ffc..cbbfdbd 100644 --- a/Software/GuitarPedal/guitar_pedal.cpp +++ b/Software/GuitarPedal/guitar_pedal.cpp @@ -22,7 +22,10 @@ using namespace daisy; using namespace daisysp; using namespace bkshepherd; -#define VARIANT_125B +// Uncomment the version you are trying to use, by default (and if nothing is +// uncommented), the 125B with 2 footswitch variant will be used + +// #define VARIANT_125B // #define VARIANT_1590B // #define VARIANT_1590B_SMD // #define VARIANT_TERRARIUM