diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..762e7dd1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +{ + "name": "CRSFforArduino development container", + "image": "mcr.microsoft.com/devcontainers/python:3.11", + "postCreateCommand": "pip install platformio", + "postStartCommand": "sudo groupadd -g 986 uucp || true && sudo usermod -aG uucp vscode", + "customizations": { + "vscode": { + "extensions": [ + "donjayamanne.githistory", + "eamodio.gitlens", + "github.vscode-github-actions", + "GitHub.vscode-pull-request-github", + "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack", + "ms-vscode.cpptools-themes", + "platformio.platformio-ide", + "streetsidesoftware.code-spell-checker", + "streetsidesoftware.code-spell-checker-australian-english", + "vivaxy.vscode-conventional-commits", + "xaver.clang-format" + ] + } + }, + "runArgs": [ + "--device=/dev/ttyACM0", + "--group-add=986" + ], + "mounts": [ + "source=/dev/bus/usb,target=/dev/bus/usb,type=bind" + ] +} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index bf23cc5f..2783b454 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,9 +13,9 @@ name: "CodeQL" on: push: - branches: [ "Main-Trunk", "Version-1.1.0-Development" ] + branches: [ "Main-Trunk" ] pull_request: - branches: [ "Main-Trunk", "Version-1.1.0-Development" ] + branches: [ "Main-Trunk" ] schedule: - cron: '31 20 * * 6' @@ -40,7 +40,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'c-cpp' ] + language: [ 'c-cpp', 'python' ] # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both @@ -93,7 +93,9 @@ jobs: # Build the Defect Detector with PlatformIO - name: Build defect detector - run: pio run -e defect_detector + run: | + cd src/build/scripts + python build.py # Perform CodeQL Analysis - name: Perform CodeQL Analysis diff --git a/.github/workflows/quality_control.yml b/.github/workflows/quality_control.yml index f19a00ec..05b61d66 100644 --- a/.github/workflows/quality_control.yml +++ b/.github/workflows/quality_control.yml @@ -2,9 +2,9 @@ name: Quality Control on: push: - branches: [ "Main-Trunk", "Version-1.1.0-Development" ] + branches: [ "Main-Trunk" ] pull_request: - branches: [ "Main-Trunk", "Version-1.1.0-Development" ] + branches: [ "Main-Trunk" ] jobs: # Code formatting with clang-format @@ -26,34 +26,9 @@ jobs: - name: Check for correct formatting with clang-format run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r . - # Static code analysis with cppcheck using PlatformIO + # New quality control script using Python and PlatformIO. defect_detector: runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4.1.1 - - uses: actions/cache@v4 - with: - path: | - ~/.cache/pip - ~/.platformio/.cache - key: ${{ runner.os }}-pio - - uses: actions/setup-python@v5 - with: - python-version: '3.9' - - name: Install PlatformIO Core - run: pip install --upgrade platformio - - - name: Build defect detector - run: pio run -e defect_detector - - - name: Run defect detector - run: pio check -e defect_detector --fail-on-defect=low --fail-on-defect=medium --fail-on-defect=high - - # Build the project with PlatformIO - build_on_compatible_targets: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4.1.1 - uses: actions/cache@v4 @@ -61,12 +36,13 @@ jobs: path: | ~/.cache/pip ~/.platformio/.cache - key: ${{ runner.os }}-pio + key: ${{runner.os}}-pio - uses: actions/setup-python@v5 with: python-version: '3.9' - - name: Install PlatformIO Core + - name: Install PlatformIO run: pip install --upgrade platformio - - - name: Build CRSF for Arduino on compatible targets - run: pio run + - name: Run Quality Control script + run: | + cd src/build/scripts + python build.py --build-on-compatible-devices diff --git a/library.json b/library.json index 5f19d9d1..8f7f8c49 100644 --- a/library.json +++ b/library.json @@ -1,7 +1,7 @@ { "$schema": "https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/schema/library.json", "name": "CRSFforArduino", - "version": "1.0.4", + "version": "2025.9.2", "description": "An Arduino Library for communicating with ExpressLRS and TBS Crossfire receivers.", "keywords": "arduino, remote-control, arduino-library, protocols, rc, radio-control, crsf, expresslrs", "repository": diff --git a/library.properties b/library.properties index 3a0d11e7..4b5edf26 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=CRSFforArduino -version=1.0.4 +version=2025.9.2 author=Cassandra Robinson maintainer=Cassandra Robinson sentence=CRSF for Arduino brings the Crossfire Protocol to the Arduino ecosystem. diff --git a/platformio.ini b/platformio.ini deleted file mode 100644 index d438cf92..00000000 --- a/platformio.ini +++ /dev/null @@ -1,39 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[platformio] -core_dir = .pio/core -default_envs = - ; defect_detector - ; development - ${build.all} -extra_configs = - targets/common.ini - targets/quality_control.ini - targets/unified_esp32.ini - targets/unified_rp2040.ini - targets/unified_samd21.ini - targets/unified_samd51.ini - targets/unified_stm32.ini - targets/unified_teensy3x.ini - targets/unified_teensy4x.ini -include_dir = src -lib_dir = src -src_dir = src -test_dir = - -; [env:development] -; board = adafruit_metro_m4 -; build_src_filter = -; +<../examples/platformio/cfa_code_test.cpp> -; +<*/*/*.cpp> -; +<*.cpp> -; build_type = debug -; extends = env_common_samd51 diff --git a/src/CFA_Config.hpp b/src/CFA_Config.hpp index 9cd45868..d67d25e8 100644 --- a/src/CFA_Config.hpp +++ b/src/CFA_Config.hpp @@ -32,13 +32,27 @@ You can change these values to suit your needs. */ namespace crsfForArduinoConfig { /* CRSFforArduino version -Versioning is done using Semantic Versioning 2.0.0. +Versioning is based on a rolling release model +and is backwards-compatible with Semantic Versioning 2.0.0. See https://semver.org/ for more information. */ -#define CRSFFORARDUINO_VERSION "1.0.4" -#define CRSFFORARDUINO_VERSION_DATE "2024-8-17" -#define CRSFFORARDUINO_VERSION_MAJOR 1 -#define CRSFFORARDUINO_VERSION_MINOR 0 -#define CRSFFORARDUINO_VERSION_PATCH 4 +#define CRSFFORARDUINO_VERSION "2025.9.2" +#define CRSFFORARDUINO_VERSION_DATE "2025-09-02" +#define CRSFFORARDUINO_VERSION_MAJOR 2025 +#define CRSFFORARDUINO_VERSION_MINOR 9 +#define CRSFFORARDUINO_VERSION_PATCH 2 + +// This is set to 1 if the version is a pre-release version. +#define CRSFFORARDUINO_VERSION_IS_PRERELEASE 0 + +// These are the pre-release version details which are only used if CRSFFORARDUINO_VERSION_IS_PRERELEASE is set to 1. +// NOTE: Pre-release versions are not recommended for production use. +// #if CRSFFORARDUINO_VERSION_IS_PRERELEASE == 1 +// #define CRSFFORARDUINO_VERSION_PRE "2025.8.30" +// #define CRSFFORARDUINO_VERSION_BUILD_DATE "2025-08-30" +// #define CRSFFORARDUINO_VERSION_BUILD_MAJOR 2025 +// #define CRSFFORARDUINO_VERSION_BUILD_MINOR 8 +// #define CRSFFORARDUINO_VERSION_BUILD_PATCH 30 +// #endif /* Failsafe Options - CRSF_FAILSAFE_LQI_THRESHOLD: The minimum LQI value for the receiver to be considered connected. @@ -107,10 +121,13 @@ and assign them to a switch on your controller. */ - DEBUG_ENABLED: Enables or disables debug output over the selected serial port. - CRSF_DEBUG_SERIAL_PORT: The serial port to use for debug output. Usually the native USB port. - CRSF_DEBUG_ENABLE_COMPATIBILITY_TABLE_OUTPUT: Enables or disables debug output from the compatibility table. -- CRSF_DEBUG_ENABLE_CONFIGURATION_DUMP: When enabled, this will print the configuration of CFA to the Serial Monitor.*/ +- CRSF_DEBUG_ENABLE_CONFIGURATION_DUMP: When enabled, this will print the configuration of CFA to the Serial Monitor. +- CRSF_DEBUG_ENABLE_VERSION_OUTPUT: When enabled, this will print the version of CFA to the Serial Monitor. */ +#define CRSF_DEBUG_ENABLED 0 #define CRSF_DEBUG_SERIAL_PORT Serial #define CRSF_DEBUG_ENABLE_COMPATIBILITY_TABLE_OUTPUT 0 #define CRSF_DEBUG_ENABLE_CONFIGURATION_DUMP 0 +#define CRSF_DEBUG_ENABLE_VERSION_OUTPUT 1 /* All warnings and asserts below this point are to ensure that the configuration is valid. */ diff --git a/src/CRSFforArduino.cpp b/src/CRSFforArduino.cpp index a6d6f1f4..596425e5 100644 --- a/src/CRSFforArduino.cpp +++ b/src/CRSFforArduino.cpp @@ -70,6 +70,22 @@ namespace sketchLayer */ bool CRSFforArduino::begin(const uint32_t baud_rate) { +#if CRSF_DEBUG_ENABLED > 0 && CRSF_DEBUG_ENABLE_VERSION_OUTPUT > 0 + CRSF_DEBUG_SERIAL_PORT.println("[CRSF for Arduino | INFO]: "); + CRSF_DEBUG_SERIAL_PORT.print("- Version: "); + CRSF_DEBUG_SERIAL_PORT.print(CRSFFORARDUINO_VERSION); +#if CRSFFORARDUINO_VERSION_IS_PRERELEASE > 0 + CRSF_DEBUG_SERIAL_PORT.print("-"); + CRSF_DEBUG_SERIAL_PORT.println(CRSFFORARDUINO_VERSION_PRE); +#endif + CRSF_DEBUG_SERIAL_PORT.print("- Version Date: "); + CRSF_DEBUG_SERIAL_PORT.println(CRSFFORARDUINO_VERSION_DATE); +#if CRSFFORARDUINO_VERSION_IS_PRERELEASE > 0 + CRSF_DEBUG_SERIAL_PORT.print("- Build Date: "); + CRSF_DEBUG_SERIAL_PORT.println(CRSFFORARDUINO_VERSION_BUILD_DATE); +#endif +#endif + #if CRSF_RC_ENABLED > 0 || CRSF_TELEMETRY_ENABLED > 0 return this->SerialReceiver::begin(baud_rate); #else @@ -174,6 +190,21 @@ namespace sketchLayer #endif } + void CRSFforArduino::setRawDataCallback(void (*callback)(int8_t byteReceived)) + { + this->SerialReceiver::setRawDataCallback(callback); + } + + void CRSFforArduino::setLinkUpCallback(void (*callback)()) + { + this->SerialReceiver::setLinkUpCallback(callback); + } + + void CRSFforArduino::setLinkDownCallback(void (*callback)()) + { + this->SerialReceiver::setLinkDownCallback(callback); + } + void CRSFforArduino::setLinkStatisticsCallback(void (*callback)(serialReceiverLayer::link_statistics_t linkStatistics)) { #if CRSF_LINK_STATISTICS_ENABLED > 0 diff --git a/src/CRSFforArduino.hpp b/src/CRSFforArduino.hpp index 75a33ea5..5626ae51 100644 --- a/src/CRSFforArduino.hpp +++ b/src/CRSFforArduino.hpp @@ -54,6 +54,10 @@ namespace sketchLayer bool setFlightMode(serialReceiverLayer::flightModeId_t flightModeId, const char *flightModeName, uint8_t channel, uint16_t min, uint16_t max); bool setFlightMode(serialReceiverLayer::flightModeId_t flightMode, uint8_t channel, uint16_t min, uint16_t max); void setFlightModeCallback(void (*callback)(serialReceiverLayer::flightModeId_t flightMode)); + void setRawDataCallback(void (*callback)(int8_t byteReceived)); + + void setLinkUpCallback(void (*callback)()); + void setLinkDownCallback(void (*callback)()); // Telemetry functions. void telemetryWriteAttitude(int16_t roll, int16_t pitch, int16_t yaw); diff --git a/src/SerialReceiver/SerialReceiver.cpp b/src/SerialReceiver/SerialReceiver.cpp index 501334d2..2a279a30 100644 --- a/src/SerialReceiver/SerialReceiver.cpp +++ b/src/SerialReceiver/SerialReceiver.cpp @@ -31,7 +31,7 @@ using namespace hal; namespace serialReceiverLayer { - SerialReceiver::SerialReceiver() + SerialReceiver::SerialReceiver(): _linkIsUp(false), _lastChannelsPacket(0) { #if defined(ARDUINO_ARCH_STM32) #if defined(HAVE_HWSERIAL1) @@ -70,7 +70,7 @@ namespace serialReceiverLayer #endif } - SerialReceiver::SerialReceiver(HardwareSerial *hwUartPort) + SerialReceiver::SerialReceiver(HardwareSerial *hwUartPort) : _linkIsUp(false), _lastChannelsPacket(0) { _uart = hwUartPort; @@ -99,7 +99,7 @@ namespace serialReceiverLayer #endif } - SerialReceiver::SerialReceiver(HardwareSerial *hwUartPort, int8_t rxPin, int8_t txPin) + SerialReceiver::SerialReceiver(HardwareSerial *hwUartPort, int8_t rxPin, int8_t txPin) : _linkIsUp(false), _lastChannelsPacket(0) { _uart = hwUartPort; @@ -128,6 +128,8 @@ namespace serialReceiverLayer _rxPin = serialReceiver._rxPin; _txPin = serialReceiver._txPin; + _linkIsUp = serialReceiver._linkIsUp; + _lastChannelsPacket= serialReceiver._lastChannelsPacket; #if CRSF_RC_ENABLED > 0 _rcChannels = new rcChannels_t; @@ -157,6 +159,11 @@ namespace serialReceiverLayer _txPin = serialReceiver._txPin; crsf = serialReceiver.crsf; + _linkIsUp = serialReceiver._linkIsUp; + _lastChannelsPacket = serialReceiver._lastChannelsPacket; + _rawDataCallback = serialReceiver._rawDataCallback; + _linkUpCallback = serialReceiver._linkUpCallback; + _linkDownCallback = serialReceiver._linkDownCallback; #if CRSF_TELEMETRY_ENABLED > 0 telemetry = serialReceiver.telemetry; @@ -522,7 +529,8 @@ namespace serialReceiverLayer { while (_uart->available() > 0) { - if (crsf->receiveFrames((uint8_t)_uart->read())) + uint8_t byteReceived = (uint8_t)_uart->read(); + if (crsf->receiveFrames(byteReceived)) { flushRemainingFrames(); @@ -549,11 +557,40 @@ namespace serialReceiverLayer _rcChannelsCallback(_rcChannels); } #endif + setLinkUp(); } + + if (_rawDataCallback != nullptr) + { + _rawDataCallback(byteReceived); + } + } + checkLinkDown(); } #endif +void SerialReceiver::setLinkDownCallback(linkDownCallback_t callback) { _linkDownCallback = callback; } +void SerialReceiver::setLinkUpCallback(linkUpCallback_t callback) { _linkUpCallback = callback; } + +bool SerialReceiver::isLinkUp() const { return _linkIsUp; } + +void SerialReceiver::setLinkUp() +{ + if (!_linkIsUp && _linkUpCallback) _linkUpCallback(); + _linkIsUp = true; + _lastChannelsPacket = millis(); +} + +void SerialReceiver::checkLinkDown() +{ + if (_linkIsUp && millis() - _lastChannelsPacket > CRSF_FAILSAFE_STAGE1_MS) { + if (_linkDownCallback) _linkDownCallback(); + _linkIsUp = false; + } +} + + #if CRSF_LINK_STATISTICS_ENABLED > 0 void SerialReceiver::setLinkStatisticsCallback(linkStatisticsCallback_t callback) { @@ -572,6 +609,11 @@ namespace serialReceiverLayer } #endif + void SerialReceiver::setRawDataCallback(rawDataCallback_t callback) + { + _rawDataCallback = callback; + } + #if CRSF_RC_ENABLED > 0 void SerialReceiver::setRcChannelsCallback(rcChannelsCallback_t callback) { diff --git a/src/SerialReceiver/SerialReceiver.hpp b/src/SerialReceiver/SerialReceiver.hpp index 082e335c..03a93e1d 100644 --- a/src/SerialReceiver/SerialReceiver.hpp +++ b/src/SerialReceiver/SerialReceiver.hpp @@ -69,10 +69,16 @@ namespace serialReceiverLayer typedef void (*rcChannelsCallback_t)(rcChannels_t *); typedef void (*flightModeCallback_t)(flightModeId_t); typedef void (*linkStatisticsCallback_t)(link_statistics_t); + typedef void (*rawDataCallback_t)(int8_t); + + typedef void (*linkUpCallback_t)(); + typedef void (*linkDownCallback_t)(); class SerialReceiver { public: + static const unsigned int CRSF_FAILSAFE_STAGE1_MS = 300; + SerialReceiver(); explicit SerialReceiver(HardwareSerial *hwUartPort); SerialReceiver(HardwareSerial *hwUartPort, int8_t rxPin, int8_t txPin); @@ -87,6 +93,8 @@ namespace serialReceiverLayer void processFrames(); #endif + + #if CRSF_LINK_STATISTICS_ENABLED > 0 void setLinkStatisticsCallback(linkStatisticsCallback_t callback); #endif @@ -106,6 +114,13 @@ namespace serialReceiverLayer #endif #endif + void setRawDataCallback(rawDataCallback_t callback); + void setLinkDownCallback(linkDownCallback_t callback); + void setLinkUpCallback(linkUpCallback_t callback); + bool isLinkUp() const; + void checkLinkDown(); + void setLinkUp(); + #if CRSF_TELEMETRY_ENABLED > 0 void telemetryWriteAttitude(int16_t roll, int16_t pitch, int16_t yaw); void telemetryWriteBaroAltitude(uint16_t altitude, int16_t vario); @@ -121,6 +136,8 @@ namespace serialReceiverLayer int8_t _rxPin = -1; int8_t _txPin = -1; + bool _linkIsUp; + uint32_t _lastChannelsPacket; #if CRSF_TELEMETRY_ENABLED > 0 Telemetry *telemetry = nullptr; @@ -156,5 +173,9 @@ namespace serialReceiverLayer #if CRSF_RC_ENABLED > 0 || CRSF_TELEMETRY_ENABLED > 0 void flushRemainingFrames(); #endif + + rawDataCallback_t _rawDataCallback = nullptr; + linkUpCallback_t _linkUpCallback = nullptr; + linkDownCallback_t _linkDownCallback = nullptr; }; } // namespace serialReceiverLayer diff --git a/src/build/scripts/build.py b/src/build/scripts/build.py new file mode 100644 index 00000000..ee03a7e3 --- /dev/null +++ b/src/build/scripts/build.py @@ -0,0 +1,81 @@ +import subprocess +import sys + +if __name__ == "__main__": + # Run the defect detector to check for any issues in the code. + command = "pio check -e defect_detector --fail-on-defect=low --fail-on-defect=medium --fail-on-defect=high" + try: + subprocess.run(command, shell=True, check=True, text=True, capture_output=True) + except subprocess.CalledProcessError as e: + print(f"{e.stdout.strip()}") + print(f"{e.stderr.strip()}") + print("There were issues detected in the code-base. Please resolve them before proceeding.") + exit(1) + + # Get the command line arguments. + args = sys.argv[1:] + # If --deploy was specified as a command line argument, deploy the code to the device. + if "--deploy" in args: + # Run the PlatformIO upload command. + command = "pio run -e development -t upload" + try: + subprocess.run(command, shell=True, check=True, text=True, capture_output=True) + except subprocess.CalledProcessError as e: + print(f"{e.stdout.strip()}") + print(f"{e.stderr.strip()}") + print("Deployment failed. Please resolve the issues before proceeding.") + exit(1) + + # If --deploy-and-monitor was specified as a command line argument, + # deploy the code to the device, wait for it to finish, and then start the serial monitor. + elif "--deploy-and-monitor" in args: + # Run the PlatformIO upload command. + command = "pio run -e development -t upload" + try: + subprocess.run(command, shell=True, check=True, text=True, capture_output=True) + except subprocess.CalledProcessError as e: + print(f"{e.stdout.strip()}") + print(f"{e.stderr.strip()}") + print("Deployment failed. Please resolve the issues before proceeding.") + exit(1) + # Start the serial monitor. + command = "pio device monitor" + try: + subprocess.run(command, shell=True, check=True, text=True) + except subprocess.CalledProcessError as e: + print(f"{e.stdout.strip()}") + print(f"{e.stderr.strip()}") + print("Failed to start the serial monitor. Please resolve the issues before proceeding.") + exit(1) + + # Check compatibility across verified devices. + # TO-DO: + # - Conduct static analysis across verified devices. + # - May need to update platformio.ini and the other targets files for this. + # - For now, this just works. + elif "--build-on-compatible-devices" in args: + # No arguments provided—defaults to building across commonly used devices. + # Because these are the ones that are tested and verified It Just Works. + command = "pio run" + try: + subprocess.run(command, shell=True, check=True, capture_output=True) + except subprocess.CalledProcessError as e: + print(f"{e.stdout.strip()}") + print(f"{e.stderr.strip()}") + print("Build failed. One or more devices are not compatible.") + exit(1) + + # If no arguments were specified, run the build command. + else: + # Run the PlatformIO build command. + command = "pio run -e development" + try: + subprocess.run(command, shell=True, check=True, text=True, capture_output=True) + except subprocess.CalledProcessError as e: + print(f"{e.stdout.strip()}") + print(f"{e.stderr.strip()}") + print("Build failed. Please resolve the issues before proceeding.") + exit(1) + + # Exit with code 0 if everything is fine. + exit(0) diff --git a/src/build/scripts/platformio.ini b/src/build/scripts/platformio.ini new file mode 100644 index 00000000..33065b45 --- /dev/null +++ b/src/build/scripts/platformio.ini @@ -0,0 +1,45 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[platformio] +core_dir = ../../../.pio/core +workspace_dir = ../../../.pio +default_envs = + ; defect_detector + ; development + ${build.commonly_used} +extra_configs = + ../../../src/build/targets/common.ini + ../../../src/build/targets/quality_control.ini + ../../../src/build/targets/unified_esp32.ini + ../../../src/build/targets/unified_rp2040.ini + ../../../src/build/targets/unified_samd21.ini + ../../../src/build/targets/unified_samd51.ini + ../../../src/build/targets/unified_stm32.ini + ../../../src/build/targets/unified_teensy3x.ini + ../../../src/build/targets/unified_teensy4x.ini +include_dir = ../../../src +lib_dir = ../../../src +src_dir = ../../../src +test_dir = + +[env:development] +board = adafruit_metro_m4 +build_src_filter = + +<../examples/platformio/main.cpp> + + + + + + + + + + + + + + +build_type = debug +extends = env_common_samd51 diff --git a/targets/common.ini b/src/build/targets/common.ini similarity index 66% rename from targets/common.ini rename to src/build/targets/common.ini index e8e98a17..3d155809 100644 --- a/targets/common.ini +++ b/src/build/targets/common.ini @@ -36,11 +36,19 @@ platform = teensy@4.18.0 [env] framework = arduino -build_src_filter = - -<../examples/platformio/cfa_code_test.cpp> +build_src_filter = +<../examples/platformio/main.cpp> - +<*/*/*.cpp> - +<*.cpp> + + + + + + + + + + + + + + + ; -<../examples/platformio/cfa_code_test.cpp> + ; +<../examples/platformio/main.cpp> + ; +<*/*/*.cpp> + ; +<*.cpp> build_unflags = -Os build_flags = diff --git a/targets/quality_control.ini b/src/build/targets/quality_control.ini similarity index 82% rename from targets/quality_control.ini rename to src/build/targets/quality_control.ini index a0e75e39..0561debc 100644 --- a/targets/quality_control.ini +++ b/src/build/targets/quality_control.ini @@ -30,10 +30,18 @@ build_flags = -DCRSF_LINK_STATISTICS_ENABLED=1 -build_src_filter = +build_src_filter = +<../examples/platformio/main.cpp> - +<*/*/*.cpp> - +<*.cpp> + + + + + + + + + + + + + + + ; +<../examples/platformio/main.cpp> + ; +<*/*/*.cpp> + ; +<*.cpp> build_type = debug check_flags = --disable=unusedFunction diff --git a/targets/unified_esp32.ini b/src/build/targets/unified_esp32.ini similarity index 100% rename from targets/unified_esp32.ini rename to src/build/targets/unified_esp32.ini diff --git a/targets/unified_rp2040.ini b/src/build/targets/unified_rp2040.ini similarity index 100% rename from targets/unified_rp2040.ini rename to src/build/targets/unified_rp2040.ini diff --git a/targets/unified_samd21.ini b/src/build/targets/unified_samd21.ini similarity index 100% rename from targets/unified_samd21.ini rename to src/build/targets/unified_samd21.ini diff --git a/targets/unified_samd51.ini b/src/build/targets/unified_samd51.ini similarity index 100% rename from targets/unified_samd51.ini rename to src/build/targets/unified_samd51.ini diff --git a/targets/unified_stm32.ini b/src/build/targets/unified_stm32.ini similarity index 100% rename from targets/unified_stm32.ini rename to src/build/targets/unified_stm32.ini diff --git a/targets/unified_teensy3x.ini b/src/build/targets/unified_teensy3x.ini similarity index 100% rename from targets/unified_teensy3x.ini rename to src/build/targets/unified_teensy3x.ini diff --git a/targets/unified_teensy4x.ini b/src/build/targets/unified_teensy4x.ini similarity index 100% rename from targets/unified_teensy4x.ini rename to src/build/targets/unified_teensy4x.ini