From 2b01f7fc4dbbd66f3575c02fd8cf899c7aad50fe Mon Sep 17 00:00:00 2001 From: Ancyker Date: Sun, 2 Jun 2024 11:56:08 -0400 Subject: Add checks for unsafe configurations * Fixes #929 * Updated `ci.yml` to define `GITHUB_CI` * Compilation will now error if VSELECT is enabled on hardware versions that don't support it (any version other than HW5). * HW4 and SERIAL might work but are untested. The error message for these versions reflects this. * Erroring when unsafe configurations are defined can be overridden by defining `ALLOW_UNSAFE_CONFIG` which will throw a warning instead. * This should only be done if trying to implement or test on a currently unsupported platform. * If both `GITHUB_CI` and `ALLOW_UNSAFE_CONFIG` are defined an error will be thrown causing the CI tests to fail. This is just in case someone makes a commit with it defined. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9217980..bdda3e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,4 +47,4 @@ jobs: cd Cart_Reader/ # Select hardware version by uncommenting it (using regular expression) sed -i 's/^\/\/[\t ]*#define ${{ matrix.hwVersion }}/#define ${{ matrix.hwVersion }}/g' Config.h - arduino-cli compile --fqbn arduino:avr:mega --warnings all + arduino-cli compile --fqbn arduino:avr:mega --warnings all --build-property compiler.cpp.extra_flags="-DGITHUB_CI" -- cgit v1.2.3