From 6605060592a60d252bb365057e57c6c9241ef675 Mon Sep 17 00:00:00 2001 From: ZZ-Cat Date: Sun, 21 Jul 2024 09:02:59 +1200 Subject: [PATCH 01/14] chore(library): Bump Semantic Version number to `1.1.0-1.0.0` and date to `2024-7-21` The `-1.0.0` suffix indicates this version is the development branch of Version 1.1.0, and is considered a "pre-release". --- examples/flight_modes/flight_modes.ino | 4 +-- examples/link_stats/link_stats.ino | 4 +-- examples/platformio/main.cpp | 4 +-- examples/rc_channels/rc_channels.ino | 4 +-- examples/telemetry/telemetry.ino | 4 +-- library.json | 2 +- library.properties | 2 +- src/CFA_Config.hpp | 25 ++++++++++++++----- src/CRSFforArduino.cpp | 4 +-- src/CRSFforArduino.hpp | 4 +-- src/SerialReceiver/CRC/CRC.cpp | 4 +-- src/SerialReceiver/CRC/CRC.hpp | 4 +-- src/SerialReceiver/CRSF/CRSF.cpp | 4 +-- src/SerialReceiver/CRSF/CRSF.hpp | 4 +-- src/SerialReceiver/CRSF/CRSFProtocol.hpp | 4 +-- .../SerialBuffer/SerialBuffer.cpp | 4 +-- .../SerialBuffer/SerialBuffer.hpp | 4 +-- src/SerialReceiver/SerialReceiver.cpp | 4 +-- src/SerialReceiver/SerialReceiver.hpp | 4 +-- src/SerialReceiver/Telemetry/Telemetry.cpp | 4 +-- src/SerialReceiver/Telemetry/Telemetry.hpp | 4 +-- .../CompatibilityTable/CompatibilityTable.cpp | 4 +-- .../CompatibilityTable/CompatibilityTable.hpp | 4 +-- 23 files changed, 61 insertions(+), 48 deletions(-) diff --git a/examples/flight_modes/flight_modes.ino b/examples/flight_modes/flight_modes.ino index 5949116b..86c8d7f3 100644 --- a/examples/flight_modes/flight_modes.ino +++ b/examples/flight_modes/flight_modes.ino @@ -2,8 +2,8 @@ * @file flight_modes.ino * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief Example of how to read flight modes from a receiver. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/examples/link_stats/link_stats.ino b/examples/link_stats/link_stats.ino index aafef459..17275d54 100644 --- a/examples/link_stats/link_stats.ino +++ b/examples/link_stats/link_stats.ino @@ -2,8 +2,8 @@ * @file link_stats.ino * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief Example of how to read link statistics from a receiver. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/examples/platformio/main.cpp b/examples/platformio/main.cpp index e0ede4ad..9f5f836a 100644 --- a/examples/platformio/main.cpp +++ b/examples/platformio/main.cpp @@ -2,8 +2,8 @@ * @file main.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This is the main development file for CRSF for Arduino. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/examples/rc_channels/rc_channels.ino b/examples/rc_channels/rc_channels.ino index e63f7ba8..d2415595 100644 --- a/examples/rc_channels/rc_channels.ino +++ b/examples/rc_channels/rc_channels.ino @@ -2,8 +2,8 @@ * @file rc_channels.ino * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief Example of how to read rc channels from a receiver. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/examples/telemetry/telemetry.ino b/examples/telemetry/telemetry.ino index c33a38d4..a98600d5 100644 --- a/examples/telemetry/telemetry.ino +++ b/examples/telemetry/telemetry.ino @@ -2,8 +2,8 @@ * @file flight_modes.ino * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief Example of how to send telemetry back to your RC handset using CRSF for Arduino. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/library.json b/library.json index 9d8294ae..9dfd96e2 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.3", + "version": "1.1.0-1.0.0", "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 2967aaff..648bedb0 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=CRSFforArduino -version=1.0.3 +version=1.1.0-1.0.0 author=Cassandra Robinson maintainer=Cassandra Robinson sentence=CRSF for Arduino brings the Crossfire Protocol to the Arduino ecosystem. diff --git a/src/CFA_Config.hpp b/src/CFA_Config.hpp index fab43a4d..4e754569 100644 --- a/src/CFA_Config.hpp +++ b/src/CFA_Config.hpp @@ -2,8 +2,8 @@ * @file CFA_Config.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This is the configuration file for CRSF for Arduino. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * @@ -36,11 +36,24 @@ namespace crsfForArduinoConfig /* CRSFforArduino version Versioning is done using Semantic Versioning 2.0.0. See https://semver.org/ for more information. */ -#define CRSFFORARDUINO_VERSION "1.0.3" -#define CRSFFORARDUINO_VERSION_DATE "2024-7-20" +#define CRSFFORARDUINO_VERSION "1.1.0" +#define CRSFFORARDUINO_VERSION_DATE "2024-7-21" #define CRSFFORARDUINO_VERSION_MAJOR 1 -#define CRSFFORARDUINO_VERSION_MINOR 0 -#define CRSFFORARDUINO_VERSION_PATCH 3 +#define CRSFFORARDUINO_VERSION_MINOR 1 +#define CRSFFORARDUINO_VERSION_PATCH 0 + +// This is set to 1 if the version is a pre-release version. +#define CRSFFORARDUINO_VERSION_IS_PRERELEASE 1 + +// 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 "1.0.0" +#define CRSFFORARDUINO_VERSION_BUILD_DATE "2024-7-21" +#define CRSFFORARDUINO_VERSION_BUILD_MAJOR 1 +#define CRSFFORARDUINO_VERSION_BUILD_MINOR 0 +#define CRSFFORARDUINO_VERSION_BUILD_PATCH 0 +#endif /* Failsafe Options - CRSF_FAILSAFE_LQI_THRESHOLD: The minimum LQI value for the receiver to be considered connected. diff --git a/src/CRSFforArduino.cpp b/src/CRSFforArduino.cpp index 2a936b0d..7abad984 100644 --- a/src/CRSFforArduino.cpp +++ b/src/CRSFforArduino.cpp @@ -3,8 +3,8 @@ * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This is the Sketch Layer, which is a simplified API for CRSF for Arduino. * It is intended to be used by the user in their sketches. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/CRSFforArduino.hpp b/src/CRSFforArduino.hpp index a9f9695d..307f9af2 100644 --- a/src/CRSFforArduino.hpp +++ b/src/CRSFforArduino.hpp @@ -3,8 +3,8 @@ * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This is the Sketch Layer, which is a simplified API for CRSF for Arduino. * It is intended to be used by the user in their sketches. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/CRC/CRC.cpp b/src/SerialReceiver/CRC/CRC.cpp index 254c69b1..00e821ec 100644 --- a/src/SerialReceiver/CRC/CRC.cpp +++ b/src/SerialReceiver/CRC/CRC.cpp @@ -2,8 +2,8 @@ * @file CRC.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief A generic CRC8 implementation for the CRSF for Arduino library. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/CRC/CRC.hpp b/src/SerialReceiver/CRC/CRC.hpp index 920b5d09..bb2710ed 100644 --- a/src/SerialReceiver/CRC/CRC.hpp +++ b/src/SerialReceiver/CRC/CRC.hpp @@ -2,8 +2,8 @@ * @file GenericCRC.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief A generic CRC8 implementation for the CRSF for Arduino library. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/CRSF/CRSF.cpp b/src/SerialReceiver/CRSF/CRSF.cpp index bc360362..4be17e0a 100644 --- a/src/SerialReceiver/CRSF/CRSF.cpp +++ b/src/SerialReceiver/CRSF/CRSF.cpp @@ -2,8 +2,8 @@ * @file CRSF.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This decodes CRSF frames from a serial port. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/CRSF/CRSF.hpp b/src/SerialReceiver/CRSF/CRSF.hpp index 5a2fa2f4..a8e18c53 100644 --- a/src/SerialReceiver/CRSF/CRSF.hpp +++ b/src/SerialReceiver/CRSF/CRSF.hpp @@ -2,8 +2,8 @@ * @file CRSF.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This decodes CRSF frames from a serial port. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/CRSF/CRSFProtocol.hpp b/src/SerialReceiver/CRSF/CRSFProtocol.hpp index 4aafa367..0a67627c 100644 --- a/src/SerialReceiver/CRSF/CRSFProtocol.hpp +++ b/src/SerialReceiver/CRSF/CRSFProtocol.hpp @@ -2,8 +2,8 @@ * @file CRSFProtocol.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This file contains enums and structs for the CRSF protocol. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/SerialBuffer/SerialBuffer.cpp b/src/SerialReceiver/SerialBuffer/SerialBuffer.cpp index 141974e7..8620aac0 100644 --- a/src/SerialReceiver/SerialBuffer/SerialBuffer.cpp +++ b/src/SerialReceiver/SerialBuffer/SerialBuffer.cpp @@ -2,8 +2,8 @@ * @file SerialBuffer.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief A generic serial buffer for the CRSF for Arduino library. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/SerialBuffer/SerialBuffer.hpp b/src/SerialReceiver/SerialBuffer/SerialBuffer.hpp index 1bd7117c..383cc5b6 100644 --- a/src/SerialReceiver/SerialBuffer/SerialBuffer.hpp +++ b/src/SerialReceiver/SerialBuffer/SerialBuffer.hpp @@ -2,8 +2,8 @@ * @file SerialBuffer.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief A generic serial buffer for the CRSF for Arduino library. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/SerialReceiver.cpp b/src/SerialReceiver/SerialReceiver.cpp index 58649378..b97da874 100644 --- a/src/SerialReceiver/SerialReceiver.cpp +++ b/src/SerialReceiver/SerialReceiver.cpp @@ -2,8 +2,8 @@ * @file SerialReceiver.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief The Serial Receiver layer for the CRSF for Arduino library. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/SerialReceiver.hpp b/src/SerialReceiver/SerialReceiver.hpp index f28f075b..461ba490 100644 --- a/src/SerialReceiver/SerialReceiver.hpp +++ b/src/SerialReceiver/SerialReceiver.hpp @@ -2,8 +2,8 @@ * @file SerialReceiver.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief The Serial Receiver layer for the CRSF for Arduino library. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/Telemetry/Telemetry.cpp b/src/SerialReceiver/Telemetry/Telemetry.cpp index dbfa2888..bf71d357 100644 --- a/src/SerialReceiver/Telemetry/Telemetry.cpp +++ b/src/SerialReceiver/Telemetry/Telemetry.cpp @@ -2,8 +2,8 @@ * @file Telemetry.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This encodes data into CRSF telemetry frames for transmission to the RC handset. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/Telemetry/Telemetry.hpp b/src/SerialReceiver/Telemetry/Telemetry.hpp index e9980bec..61be5d37 100644 --- a/src/SerialReceiver/Telemetry/Telemetry.hpp +++ b/src/SerialReceiver/Telemetry/Telemetry.hpp @@ -2,8 +2,8 @@ * @file Telemetry.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This encodes data into CRSF telemetry frames for transmission to the RC handset. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/hal/CompatibilityTable/CompatibilityTable.cpp b/src/hal/CompatibilityTable/CompatibilityTable.cpp index 099afedb..a934751b 100644 --- a/src/hal/CompatibilityTable/CompatibilityTable.cpp +++ b/src/hal/CompatibilityTable/CompatibilityTable.cpp @@ -2,8 +2,8 @@ * @file CompatibilityTable.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief The Compatibility Table determines if the target development board is compatible with CRSF for Arduino. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/hal/CompatibilityTable/CompatibilityTable.hpp b/src/hal/CompatibilityTable/CompatibilityTable.hpp index 47f69820..175a5a1d 100644 --- a/src/hal/CompatibilityTable/CompatibilityTable.hpp +++ b/src/hal/CompatibilityTable/CompatibilityTable.hpp @@ -2,8 +2,8 @@ * @file CompatibilityTable.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief The Compatibility Table determines if the target development board is compatible with CRSF for Arduino. - * @version 1.0.3 - * @date 2024-7-20 + * @version 1.1.0-1.0.0 + * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * From c7a279804d222106672f4be642bb5e2ac37c1684 Mon Sep 17 00:00:00 2001 From: ZZ-Cat Date: Sun, 21 Jul 2024 09:07:09 +1200 Subject: [PATCH 02/14] build(`platformio.ini`): :construction_worker: Set the Development environment as the default for this branch --- platformio.ini | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/platformio.ini b/platformio.ini index d438cf92..a0883b29 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,8 +12,8 @@ core_dir = .pio/core default_envs = ; defect_detector - ; development - ${build.all} + development + ; ${build.all} extra_configs = targets/common.ini targets/quality_control.ini @@ -29,11 +29,11 @@ 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 +[env:development] +board = adafruit_metro_m4 +build_src_filter = + +<../examples/platformio/main.cpp> + +<*/*/*.cpp> + +<*.cpp> +build_type = debug +extends = env_common_samd51 From b2445b0759d116c94c47114eecc1d9ff6390f56e Mon Sep 17 00:00:00 2001 From: ZZ-Cat Date: Sun, 21 Jul 2024 09:09:35 +1200 Subject: [PATCH 03/14] chore(config): :wrench: Enable debug outputs to the Serial Monitor --- src/CFA_Config.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CFA_Config.hpp b/src/CFA_Config.hpp index 4e754569..dc42eda9 100644 --- a/src/CFA_Config.hpp +++ b/src/CFA_Config.hpp @@ -122,9 +122,9 @@ 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. */ -#define CRSF_DEBUG_ENABLED 0 +#define CRSF_DEBUG_ENABLED 1 #define CRSF_DEBUG_SERIAL_PORT Serial -#define CRSF_DEBUG_ENABLE_COMPATIBILITY_TABLE_OUTPUT 0 +#define CRSF_DEBUG_ENABLE_COMPATIBILITY_TABLE_OUTPUT 1 /* All warnings and asserts below this point are to ensure that the configuration is valid. */ From 35625e49a37fc0bee35446fbe61d938aeb364195 Mon Sep 17 00:00:00 2001 From: ZZ-Cat Date: Sun, 21 Jul 2024 09:33:35 +1200 Subject: [PATCH 04/14] build(library): Print Semantic Version information when `CRSF_DEBUG_ENABLED` and `CRSF_DEBUG_ENABLE_VERSION_OUTPUT` are both set to `1` --- src/CFA_Config.hpp | 1 + src/CRSFforArduino.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/CFA_Config.hpp b/src/CFA_Config.hpp index dc42eda9..3ab50c29 100644 --- a/src/CFA_Config.hpp +++ b/src/CFA_Config.hpp @@ -125,6 +125,7 @@ and assign them to a switch on your controller. */ #define CRSF_DEBUG_ENABLED 1 #define CRSF_DEBUG_SERIAL_PORT Serial #define CRSF_DEBUG_ENABLE_COMPATIBILITY_TABLE_OUTPUT 1 +#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 7abad984..e5376650 100644 --- a/src/CRSFforArduino.cpp +++ b/src/CRSFforArduino.cpp @@ -72,6 +72,22 @@ namespace sketchLayer */ bool CRSFforArduino::begin() { +#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(); #else From 0adcb9ab9876ea5e9c5e500eace89bb46255074e Mon Sep 17 00:00:00 2001 From: "Cassandra \"ZZ Cat\" Robinson" Date: Sat, 31 Aug 2024 08:36:35 +1200 Subject: [PATCH 05/14] chore(library): Discontinue V1.0.x-maintenance-branch (#136) Development focus is now on the upcoming Version 1.1.0 of CRSF for Arduino. --- .github/workflows/codeql.yml | 4 +- .github/workflows/quality_control.yml | 4 +- examples/flight_modes/flight_modes.ino | 2 - examples/link_stats/link_stats.ino | 2 - examples/platformio/main.cpp | 2 - examples/rc_channels/rc_channels.ino | 2 - examples/telemetry/telemetry.ino | 2 - src/CFA_Config.hpp | 10 +- src/CRSFforArduino.cpp | 6 +- src/CRSFforArduino.hpp | 4 +- src/SerialReceiver/CRC/CRC.cpp | 2 - src/SerialReceiver/CRC/CRC.hpp | 2 - src/SerialReceiver/CRSF/CRSF.cpp | 4 +- src/SerialReceiver/CRSF/CRSF.hpp | 2 - src/SerialReceiver/CRSF/CRSFProtocol.hpp | 5 +- .../SerialBuffer/SerialBuffer.cpp | 2 - .../SerialBuffer/SerialBuffer.hpp | 2 - src/SerialReceiver/SerialReceiver.cpp | 199 +++++++++++++++++- src/SerialReceiver/SerialReceiver.hpp | 4 +- src/SerialReceiver/Telemetry/Telemetry.cpp | 2 - src/SerialReceiver/Telemetry/Telemetry.hpp | 2 - .../CompatibilityTable/CompatibilityTable.cpp | 2 - .../CompatibilityTable/CompatibilityTable.hpp | 4 +- 23 files changed, 206 insertions(+), 64 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3ef5b72b..bf23cc5f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,9 +13,9 @@ name: "CodeQL" on: push: - branches: [ "Main-Trunk" ] + branches: [ "Main-Trunk", "Version-1.1.0-Development" ] pull_request: - branches: [ "Main-Trunk" ] + branches: [ "Main-Trunk", "Version-1.1.0-Development" ] schedule: - cron: '31 20 * * 6' diff --git a/.github/workflows/quality_control.yml b/.github/workflows/quality_control.yml index 7a08885e..f19a00ec 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" ] + branches: [ "Main-Trunk", "Version-1.1.0-Development" ] pull_request: - branches: [ "Main-Trunk" ] + branches: [ "Main-Trunk", "Version-1.1.0-Development" ] jobs: # Code formatting with clang-format diff --git a/examples/flight_modes/flight_modes.ino b/examples/flight_modes/flight_modes.ino index 86c8d7f3..19dfd392 100644 --- a/examples/flight_modes/flight_modes.ino +++ b/examples/flight_modes/flight_modes.ino @@ -2,8 +2,6 @@ * @file flight_modes.ino * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief Example of how to read flight modes from a receiver. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/examples/link_stats/link_stats.ino b/examples/link_stats/link_stats.ino index 17275d54..e0e3ee5a 100644 --- a/examples/link_stats/link_stats.ino +++ b/examples/link_stats/link_stats.ino @@ -2,8 +2,6 @@ * @file link_stats.ino * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief Example of how to read link statistics from a receiver. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/examples/platformio/main.cpp b/examples/platformio/main.cpp index 9f5f836a..47cf3bed 100644 --- a/examples/platformio/main.cpp +++ b/examples/platformio/main.cpp @@ -2,8 +2,6 @@ * @file main.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This is the main development file for CRSF for Arduino. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/examples/rc_channels/rc_channels.ino b/examples/rc_channels/rc_channels.ino index d2415595..292bbe6f 100644 --- a/examples/rc_channels/rc_channels.ino +++ b/examples/rc_channels/rc_channels.ino @@ -2,8 +2,6 @@ * @file rc_channels.ino * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief Example of how to read rc channels from a receiver. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/examples/telemetry/telemetry.ino b/examples/telemetry/telemetry.ino index a98600d5..f07ae4c4 100644 --- a/examples/telemetry/telemetry.ino +++ b/examples/telemetry/telemetry.ino @@ -2,8 +2,6 @@ * @file flight_modes.ino * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief Example of how to send telemetry back to your RC handset using CRSF for Arduino. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/CFA_Config.hpp b/src/CFA_Config.hpp index 3ab50c29..0382e3c7 100644 --- a/src/CFA_Config.hpp +++ b/src/CFA_Config.hpp @@ -2,8 +2,6 @@ * @file CFA_Config.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This is the configuration file for CRSF for Arduino. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * @@ -121,11 +119,11 @@ and assign them to a switch on your controller. */ /* Debug Options - 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. */ -#define CRSF_DEBUG_ENABLED 1 +- 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.*/ #define CRSF_DEBUG_SERIAL_PORT Serial -#define CRSF_DEBUG_ENABLE_COMPATIBILITY_TABLE_OUTPUT 1 -#define CRSF_DEBUG_ENABLE_VERSION_OUTPUT 1 +#define CRSF_DEBUG_ENABLE_COMPATIBILITY_TABLE_OUTPUT 0 +#define CRSF_DEBUG_ENABLE_CONFIGURATION_DUMP 0 /* 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 e5376650..66e40b1f 100644 --- a/src/CRSFforArduino.cpp +++ b/src/CRSFforArduino.cpp @@ -3,8 +3,6 @@ * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This is the Sketch Layer, which is a simplified API for CRSF for Arduino. * It is intended to be used by the user in their sketches. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * @@ -70,7 +68,7 @@ namespace sketchLayer * * @return true if CRSF for Arduino was initialised successfully. */ - bool CRSFforArduino::begin() + 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]: "); @@ -89,7 +87,7 @@ namespace sketchLayer #endif #if CRSF_RC_ENABLED > 0 || CRSF_TELEMETRY_ENABLED > 0 - return this->SerialReceiver::begin(); + return this->SerialReceiver::begin(baud_rate); #else // Return false if RC is disabled return false; diff --git a/src/CRSFforArduino.hpp b/src/CRSFforArduino.hpp index 307f9af2..75a33ea5 100644 --- a/src/CRSFforArduino.hpp +++ b/src/CRSFforArduino.hpp @@ -3,8 +3,6 @@ * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This is the Sketch Layer, which is a simplified API for CRSF for Arduino. * It is intended to be used by the user in their sketches. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * @@ -39,7 +37,7 @@ namespace sketchLayer explicit CRSFforArduino(HardwareSerial *serialPort); CRSFforArduino(HardwareSerial *serialPort, int rxPin, int txPin); ~CRSFforArduino(); - bool begin(); + bool begin(const uint32_t baud_rate = crsfProtocol::BAUD_RATE); void end(); void update(); diff --git a/src/SerialReceiver/CRC/CRC.cpp b/src/SerialReceiver/CRC/CRC.cpp index 00e821ec..439fbefb 100644 --- a/src/SerialReceiver/CRC/CRC.cpp +++ b/src/SerialReceiver/CRC/CRC.cpp @@ -2,8 +2,6 @@ * @file CRC.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief A generic CRC8 implementation for the CRSF for Arduino library. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/CRC/CRC.hpp b/src/SerialReceiver/CRC/CRC.hpp index bb2710ed..bad784f4 100644 --- a/src/SerialReceiver/CRC/CRC.hpp +++ b/src/SerialReceiver/CRC/CRC.hpp @@ -2,8 +2,6 @@ * @file GenericCRC.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief A generic CRC8 implementation for the CRSF for Arduino library. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/CRSF/CRSF.cpp b/src/SerialReceiver/CRSF/CRSF.cpp index 4be17e0a..debe5751 100644 --- a/src/SerialReceiver/CRSF/CRSF.cpp +++ b/src/SerialReceiver/CRSF/CRSF.cpp @@ -2,8 +2,6 @@ * @file CRSF.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This decodes CRSF frames from a serial port. - * @version 1.1.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * @@ -124,7 +122,7 @@ namespace serialReceiverLayer frameStartTime = currentTime; } - /* Assume the full frame lenthg is 5 bytes until the frame length byte is received. */ + /* Assume the full frame length is 5 bytes until the frame length byte is received. */ const int fullFrameLength = framePosition < 3 ? 5 : min(rxFrame.frame.frameLength + CRSF_FRAME_LENGTH_ADDRESS + CRSF_FRAME_LENGTH_FRAMELENGTH, (int)CRSF_FRAME_SIZE_MAX); if (framePosition < fullFrameLength) diff --git a/src/SerialReceiver/CRSF/CRSF.hpp b/src/SerialReceiver/CRSF/CRSF.hpp index a8e18c53..4805c523 100644 --- a/src/SerialReceiver/CRSF/CRSF.hpp +++ b/src/SerialReceiver/CRSF/CRSF.hpp @@ -2,8 +2,6 @@ * @file CRSF.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This decodes CRSF frames from a serial port. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/CRSF/CRSFProtocol.hpp b/src/SerialReceiver/CRSF/CRSFProtocol.hpp index 0a67627c..cfdacfaa 100644 --- a/src/SerialReceiver/CRSF/CRSFProtocol.hpp +++ b/src/SerialReceiver/CRSF/CRSFProtocol.hpp @@ -2,8 +2,6 @@ * @file CRSFProtocol.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This file contains enums and structs for the CRSF protocol. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * @@ -263,6 +261,7 @@ namespace crsfProtocol enum baudRate_e { - BAUD_RATE = 420000 + BAUD_RATE_LEGACY = 420000, + BAUD_RATE = 416666 }; } // namespace crsfProtocol diff --git a/src/SerialReceiver/SerialBuffer/SerialBuffer.cpp b/src/SerialReceiver/SerialBuffer/SerialBuffer.cpp index 8620aac0..7d92f790 100644 --- a/src/SerialReceiver/SerialBuffer/SerialBuffer.cpp +++ b/src/SerialReceiver/SerialBuffer/SerialBuffer.cpp @@ -2,8 +2,6 @@ * @file SerialBuffer.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief A generic serial buffer for the CRSF for Arduino library. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/SerialBuffer/SerialBuffer.hpp b/src/SerialReceiver/SerialBuffer/SerialBuffer.hpp index 383cc5b6..af1601e3 100644 --- a/src/SerialReceiver/SerialBuffer/SerialBuffer.hpp +++ b/src/SerialReceiver/SerialBuffer/SerialBuffer.hpp @@ -2,8 +2,6 @@ * @file SerialBuffer.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief A generic serial buffer for the CRSF for Arduino library. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/SerialReceiver.cpp b/src/SerialReceiver/SerialReceiver.cpp index b97da874..501334d2 100644 --- a/src/SerialReceiver/SerialReceiver.cpp +++ b/src/SerialReceiver/SerialReceiver.cpp @@ -2,8 +2,6 @@ * @file SerialReceiver.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief The Serial Receiver layer for the CRSF for Arduino library. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * @@ -212,9 +210,36 @@ namespace serialReceiverLayer #endif } - bool SerialReceiver::begin() + bool SerialReceiver::begin(const uint32_t baudRate) { #if CRSF_DEBUG_ENABLED > 0 + for (int i = 0; i < 93; i++) + { + CRSF_DEBUG_SERIAL_PORT.print("="); + } + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.flush(); + + CRSF_DEBUG_SERIAL_PORT.println("Cassie Robinson's"); + CRSF_DEBUG_SERIAL_PORT.println("CRSF for Arduino"); + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.flush(); + + CRSF_DEBUG_SERIAL_PORT.print("Version: "); + CRSF_DEBUG_SERIAL_PORT.println(CRSFFORARDUINO_VERSION); + CRSF_DEBUG_SERIAL_PORT.print("Build date: "); + CRSF_DEBUG_SERIAL_PORT.println(CRSFFORARDUINO_VERSION_DATE); + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.flush(); + + for (int i = 0; i < 93; i++) + { + CRSF_DEBUG_SERIAL_PORT.print("-"); + } + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.flush(); + CRSF_DEBUG_SERIAL_PORT.print("[Serial Receiver | INFO]: Initialising... "); #endif @@ -262,13 +287,23 @@ namespace serialReceiverLayer /* Check if the target development board is compatible with the CRSF Protocol, and return false if it isn't. */ CompatibilityTable *ct = new CompatibilityTable(); - if (!ct->isDevboardCompatible(ct->getDevboardName())) + const char *devboardName = ct->getDevboardName(); + if (!ct->isDevboardCompatible(devboardName)) { delete ct; ct = nullptr; #if CRSF_DEBUG_ENABLED > 0 - CRSF_DEBUG_SERIAL_PORT.println("\r\n[Serial Receiver | FATAL ERROR]: Devboard is not compatible with CRSF Protocol."); +#if CRSF_DEBUG_ENABLE_COMPATIBILITY_TABLE_OUTPUT == 0 + CRSF_DEBUG_SERIAL_PORT.println("\r\n[Serial Receiver | FATAL ERROR]: Your device is not compatible with CRSF for Arduino."); +#endif + + for (int i = 0; i < 93; i++) + { + CRSF_DEBUG_SERIAL_PORT.print("="); + } + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.flush(); #endif return false; } @@ -279,11 +314,11 @@ namespace serialReceiverLayer /* Initialise the CRSF Protocol and Telemetry. */ crsf = new CRSF(); crsf->begin(); - crsf->setFrameTime(BAUD_RATE, 10); + crsf->setFrameTime(baudRate, 10); #if defined(ARDUINO_ARCH_ESP32) - _uart->begin(BAUD_RATE, SERIAL_8N1, _rxPin, _txPin); + _uart->begin(baudRate, SERIAL_8N1, _rxPin, _txPin); #else - _uart->begin(BAUD_RATE); + _uart->begin(baudRate); #endif #if CRSF_TELEMETRY_ENABLED > 0 @@ -300,6 +335,152 @@ namespace serialReceiverLayer #if CRSF_DEBUG_ENABLED > 0 CRSF_DEBUG_SERIAL_PORT.println("Done."); + + +#if CRSF_DEBUG_ENABLE_CONFIGURATION_DUMP > 0 + for (int i = 0; i < 93; i++) + { + CRSF_DEBUG_SERIAL_PORT.print("-"); + } + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.flush(); + + CRSF_DEBUG_SERIAL_PORT.println("CRSF for Arduino initialised with the following configuration:"); + + CRSF_DEBUG_SERIAL_PORT.println(" - Device:"); + CRSF_DEBUG_SERIAL_PORT.print(" - Name: "); + CRSF_DEBUG_SERIAL_PORT.println(devboardName); + CRSF_DEBUG_SERIAL_PORT.println(" - UART:"); + CRSF_DEBUG_SERIAL_PORT.print(" - Baud rate: "); + CRSF_DEBUG_SERIAL_PORT.println(baudRate); + CRSF_DEBUG_SERIAL_PORT.print(" - Rx pin: "); + CRSF_DEBUG_SERIAL_PORT.println(_rxPin == -1 ? PIN_SERIAL1_RX : _rxPin); + CRSF_DEBUG_SERIAL_PORT.print(" - Tx pin: "); + CRSF_DEBUG_SERIAL_PORT.println(_txPin == -1 ? PIN_SERIAL1_TX : _txPin); + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.flush(); + + CRSF_DEBUG_SERIAL_PORT.println(" - Failsafe thresholds:"); + CRSF_DEBUG_SERIAL_PORT.print(" - LQI threshold: "); + CRSF_DEBUG_SERIAL_PORT.println(CRSF_FAILSAFE_LQI_THRESHOLD); + CRSF_DEBUG_SERIAL_PORT.print(" - RSSI threshold: "); + CRSF_DEBUG_SERIAL_PORT.println(CRSF_FAILSAFE_RSSI_THRESHOLD); + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.flush(); + + CRSF_DEBUG_SERIAL_PORT.println(" - RC Channels API:"); + CRSF_DEBUG_SERIAL_PORT.print(" - Enabled: "); +#if CRSF_RC_ENABLED > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); + + CRSF_DEBUG_SERIAL_PORT.print(" - RC channels: "); + CRSF_DEBUG_SERIAL_PORT.println(CRSF_RC_MAX_CHANNELS); + CRSF_DEBUG_SERIAL_PORT.print(" - Minimum RC Channel value: "); + CRSF_DEBUG_SERIAL_PORT.println((uint16_t)((CRSF_RC_CHANNEL_MIN * 0.62477120195241F) + 881)); + CRSF_DEBUG_SERIAL_PORT.print(" - Maximum RC Channel value: "); + CRSF_DEBUG_SERIAL_PORT.println((uint16_t)((CRSF_RC_CHANNEL_MAX * 0.62477120195241F) + 881)); + CRSF_DEBUG_SERIAL_PORT.print(" - Center RC Channel value: "); + CRSF_DEBUG_SERIAL_PORT.println((uint16_t)((CRSF_RC_CHANNEL_CENTER * 0.62477120195241F) + 881)); + + CRSF_DEBUG_SERIAL_PORT.print(" - Initialise RC channels: "); +#if CRSF_RC_INITIALISE_CHANNELS > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); + + CRSF_DEBUG_SERIAL_PORT.print(" - Initialise Arm channel: "); +#if CRSF_RC_INITIALISE_ARMCHANNEL > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); +#else + CRSF_DEBUG_SERIAL_PORT.println("No"); +#endif + + CRSF_DEBUG_SERIAL_PORT.print(" - Initialise Throttle channel: "); +#if CRSF_RC_INITIALISE_THROTTLECHANNEL > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); +#else + CRSF_DEBUG_SERIAL_PORT.println("No"); +#endif +#else + CRSF_DEBUG_SERIAL_PORT.println("No"); +#endif +#endif + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.flush(); + + CRSF_DEBUG_SERIAL_PORT.println(" - Flight Modes API:"); + CRSF_DEBUG_SERIAL_PORT.print(" - Enabled: "); +#if CRSF_FLIGHTMODES_ENABLED > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); + + CRSF_DEBUG_SERIAL_PORT.print(" - Custom Flight Modes enabled: "); +#if CRSF_CUSTOM_FLIGHT_MODES_ENABLED > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); +#else + CRSF_DEBUG_SERIAL_PORT.println("No"); +#endif +#else + CRSF_DEBUG_SERIAL_PORT.println("No"); +#endif + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.flush(); + + + CRSF_DEBUG_SERIAL_PORT.println(" - Telemetry API:"); + CRSF_DEBUG_SERIAL_PORT.print(" - Enabled: "); +#if CRSF_TELEMETRY_ENABLED > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); + + CRSF_DEBUG_SERIAL_PORT.print(" - Attitude telemetry enabled: "); +#if CRSF_TELEMETRY_ATTITUDE_ENABLED > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); +#else + CRSF_DEBUG_SERIAL_PORT.println("No"); +#endif + + CRSF_DEBUG_SERIAL_PORT.print(" - Barometric altitude telemetry enabled: "); +#if CRSF_TELEMETRY_BAROALTITUDE_ENABLED > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); +#else + CRSF_DEBUG_SERIAL_PORT.println("No"); +#endif + + CRSF_DEBUG_SERIAL_PORT.print(" - Battery telemetry enabled: "); +#if CRSF_TELEMETRY_BATTERY_ENABLED > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); +#else + CRSF_DEBUG_SERIAL_PORT.println("No"); +#endif + + CRSF_DEBUG_SERIAL_PORT.print(" - Flight Mode telemetry enabled: "); +#if CRSF_TELEMETRY_FLIGHTMODE_ENABLED > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); +#else + CRSF_DEBUG_SERIAL_PORT.println("No"); +#endif + + CRSF_DEBUG_SERIAL_PORT.print(" - GPS telemetry enabled: "); +#if CRSF_TELEMETRY_GPS_ENABLED > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); +#else + CRSF_DEBUG_SERIAL_PORT.println("No"); +#endif + + CRSF_DEBUG_SERIAL_PORT.print(" - Link Statistics telemetry enabled: "); +#if CRSF_LINK_STATISTICS_ENABLED > 0 + CRSF_DEBUG_SERIAL_PORT.println("Yes"); +#else + CRSF_DEBUG_SERIAL_PORT.println("No"); +#endif +#endif + CRSF_DEBUG_SERIAL_PORT.println(); +#endif + + for (int i = 0; i < 93; i++) + { + CRSF_DEBUG_SERIAL_PORT.print("="); + } + CRSF_DEBUG_SERIAL_PORT.println(); + CRSF_DEBUG_SERIAL_PORT.flush(); #endif return true; } @@ -408,7 +589,7 @@ namespace serialReceiverLayer else { /* Convert RC value from raw to microseconds. - - Mininum: 172 (988us) + - Minimum: 172 (988us) - Middle: 992 (1500us) - Maximum: 1811 (2012us) - Scale factor = (2012 - 988) / (1811 - 172) = 0.62477120195241 diff --git a/src/SerialReceiver/SerialReceiver.hpp b/src/SerialReceiver/SerialReceiver.hpp index 461ba490..082e335c 100644 --- a/src/SerialReceiver/SerialReceiver.hpp +++ b/src/SerialReceiver/SerialReceiver.hpp @@ -2,8 +2,6 @@ * @file SerialReceiver.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief The Serial Receiver layer for the CRSF for Arduino library. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * @@ -82,7 +80,7 @@ namespace serialReceiverLayer SerialReceiver &operator=(const SerialReceiver &serialReceiver); virtual ~SerialReceiver(); - bool begin(); + bool begin(const uint32_t baudRate); void end(); #if CRSF_RC_ENABLED > 0 || CRSF_TELEMETRY_ENABLED > 0 || CRSF_LINK_STATISTICS_ENABLED > 0 diff --git a/src/SerialReceiver/Telemetry/Telemetry.cpp b/src/SerialReceiver/Telemetry/Telemetry.cpp index bf71d357..8a7ba7e2 100644 --- a/src/SerialReceiver/Telemetry/Telemetry.cpp +++ b/src/SerialReceiver/Telemetry/Telemetry.cpp @@ -2,8 +2,6 @@ * @file Telemetry.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This encodes data into CRSF telemetry frames for transmission to the RC handset. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/SerialReceiver/Telemetry/Telemetry.hpp b/src/SerialReceiver/Telemetry/Telemetry.hpp index 61be5d37..e12b5a40 100644 --- a/src/SerialReceiver/Telemetry/Telemetry.hpp +++ b/src/SerialReceiver/Telemetry/Telemetry.hpp @@ -2,8 +2,6 @@ * @file Telemetry.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief This encodes data into CRSF telemetry frames for transmission to the RC handset. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/hal/CompatibilityTable/CompatibilityTable.cpp b/src/hal/CompatibilityTable/CompatibilityTable.cpp index a934751b..8a60e2bc 100644 --- a/src/hal/CompatibilityTable/CompatibilityTable.cpp +++ b/src/hal/CompatibilityTable/CompatibilityTable.cpp @@ -2,8 +2,6 @@ * @file CompatibilityTable.cpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief The Compatibility Table determines if the target development board is compatible with CRSF for Arduino. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * diff --git a/src/hal/CompatibilityTable/CompatibilityTable.hpp b/src/hal/CompatibilityTable/CompatibilityTable.hpp index 175a5a1d..0b206f0c 100644 --- a/src/hal/CompatibilityTable/CompatibilityTable.hpp +++ b/src/hal/CompatibilityTable/CompatibilityTable.hpp @@ -2,8 +2,6 @@ * @file CompatibilityTable.hpp * @author Cassandra "ZZ Cat" Robinson (nicad.heli.flier@gmail.com) * @brief The Compatibility Table determines if the target development board is compatible with CRSF for Arduino. - * @version 1.1.0-1.0.0 - * @date 2024-7-21 * * @copyright Copyright (c) 2024, Cassandra "ZZ Cat" Robinson. All rights reserved. * @@ -104,7 +102,7 @@ namespace hal DEVBOARD_ARDUINO_PORTENTA_H7, DEVBOARD_ARDUINO_PORTENTA_H7_M4, - // Espresif ESP32 boards. + // Espressif ESP32 boards. DEVBOARD_ESPRESSIF_ESP32C3_DEVKIT, DEVBOARD_ESPRESSIF_ESP32S3_DEVKIT, From 931ed5af1d6bcab7f84849660bb99d5e31b8349e Mon Sep 17 00:00:00 2001 From: ZZ-Cat Date: Sat, 31 Aug 2024 09:56:47 +1200 Subject: [PATCH 06/14] chore(`CFA_Config.hpp`): :wrench: Add missing preprocessor defines These were obliterated in the previous re-base. --- src/CFA_Config.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CFA_Config.hpp b/src/CFA_Config.hpp index 0382e3c7..2c6425f9 100644 --- a/src/CFA_Config.hpp +++ b/src/CFA_Config.hpp @@ -120,10 +120,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. */ From 090215059d29e596bbe6f398b8e6131affa42deb Mon Sep 17 00:00:00 2001 From: ddanilchenko Date: Sun, 1 Sep 2024 00:09:57 +0300 Subject: [PATCH 07/14] feat(serial receiver interface): :sparkles: Introduce three new callbacks (#134) Three new callback functions are added to the Serial Receiver Interface: - `onLinkDownCallback` Runs when no CRSF data is received within `CRSF_FAILSAFE_STAGE1_MS` (default is 300 milliseconds), and this may be used to facilitate fail-safe conditions. - `onLinkUpCallback` Runs when a reconnection is established, and this may be used to facilitate fail-safe recovery. - `onRawDataCallback` Runs whenever individual bytes from the raw CRSF data stream is received, and this may be used to facilitate UART pass-through. Signed-off-by: Dmytro Co-authored-by: Cassandra "ZZ Cat" Robinson --- src/CRSFforArduino.cpp | 15 ++++++++ src/CRSFforArduino.hpp | 4 +++ src/SerialReceiver/SerialReceiver.cpp | 50 ++++++++++++++++++++++++--- src/SerialReceiver/SerialReceiver.hpp | 21 +++++++++++ 4 files changed, 86 insertions(+), 4 deletions(-) diff --git a/src/CRSFforArduino.cpp b/src/CRSFforArduino.cpp index 66e40b1f..596425e5 100644 --- a/src/CRSFforArduino.cpp +++ b/src/CRSFforArduino.cpp @@ -190,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 From 25b475e2eb41e318d8ae394f79bc270d886e6340 Mon Sep 17 00:00:00 2001 From: "Cassandra \"ZZ Cat\" Robinson" Date: Sun, 29 Jun 2025 10:22:22 +1200 Subject: [PATCH 08/14] Containerise CFA (#154) CRSF for Arduin is now developed in a Dev Container. --- .devcontainer/devcontainer.json | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..f2e4ca7b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,30 @@ +{ + "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", + "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" + ] +} From 4e67ab5f04f0be7ce8b5b7b888ae6ad4cf5d9155 Mon Sep 17 00:00:00 2001 From: "Cassandra \"ZZ Cat\" Robinson" Date: Sat, 30 Aug 2025 09:02:03 +1200 Subject: [PATCH 09/14] ci(quality control): Simplify QC, build, and check process (#156) ## Changes This is a Python rewrite of the old Bash scripts used to start the Quality Control CI pipeline. ## Breaking changes This pull request breaks the existing QC and vulnerability scanning CI workflows, because I changed the directories around to be more aligned with CFA's development container and I moved the main `platformio.ini` file away into a folder that houses the build script to run everything from there. So, the existing CI is expecting that `platformio.ini` file to still be present in CFA's root. --- .devcontainer/devcontainer.json | 1 + .github/workflows/quality_control.yml | 36 ++------- platformio.ini | 39 --------- src/build/scripts/build.py | 81 +++++++++++++++++++ src/build/scripts/platformio.ini | 45 +++++++++++ {targets => src/build/targets}/common.ini | 18 +++-- .../build/targets}/quality_control.ini | 16 +++- .../build/targets}/unified_esp32.ini | 0 .../build/targets}/unified_rp2040.ini | 0 .../build/targets}/unified_samd21.ini | 0 .../build/targets}/unified_samd51.ini | 0 .../build/targets}/unified_stm32.ini | 0 .../build/targets}/unified_teensy3x.ini | 0 .../build/targets}/unified_teensy4x.ini | 0 14 files changed, 157 insertions(+), 79 deletions(-) delete mode 100644 platformio.ini create mode 100644 src/build/scripts/build.py create mode 100644 src/build/scripts/platformio.ini rename {targets => src/build/targets}/common.ini (53%) rename {targets => src/build/targets}/quality_control.ini (73%) rename {targets => src/build/targets}/unified_esp32.ini (100%) rename {targets => src/build/targets}/unified_rp2040.ini (100%) rename {targets => src/build/targets}/unified_samd21.ini (100%) rename {targets => src/build/targets}/unified_samd51.ini (100%) rename {targets => src/build/targets}/unified_stm32.ini (100%) rename {targets => src/build/targets}/unified_teensy3x.ini (100%) rename {targets => src/build/targets}/unified_teensy4x.ini (100%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f2e4ca7b..762e7dd1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -15,6 +15,7 @@ "ms-vscode.cpptools-themes", "platformio.platformio-ide", "streetsidesoftware.code-spell-checker", + "streetsidesoftware.code-spell-checker-australian-english", "vivaxy.vscode-conventional-commits", "xaver.clang-format" ] diff --git a/.github/workflows/quality_control.yml b/.github/workflows/quality_control.yml index f19a00ec..e08a92c2 100644 --- a/.github/workflows/quality_control.yml +++ b/.github/workflows/quality_control.yml @@ -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,11 @@ 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/platformio.ini b/platformio.ini deleted file mode 100644 index a0883b29..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/main.cpp> - +<*/*/*.cpp> - +<*.cpp> -build_type = debug -extends = env_common_samd51 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..336bae04 --- /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 = /workspaces/CRSFforArduino/.pio/core +workspace_dir = /workspaces/CRSFforArduino/.pio +default_envs = + ; defect_detector + ; development + ${build.commonly_used} +extra_configs = + /workspaces/CRSFforArduino/src/build/targets/common.ini + /workspaces/CRSFforArduino/src/build/targets/quality_control.ini + /workspaces/CRSFforArduino/src/build/targets/unified_esp32.ini + /workspaces/CRSFforArduino/src/build/targets/unified_rp2040.ini + /workspaces/CRSFforArduino/src/build/targets/unified_samd21.ini + /workspaces/CRSFforArduino/src/build/targets/unified_samd51.ini + /workspaces/CRSFforArduino/src/build/targets/unified_stm32.ini + /workspaces/CRSFforArduino/src/build/targets/unified_teensy3x.ini + /workspaces/CRSFforArduino/src/build/targets/unified_teensy4x.ini +include_dir = /workspaces/CRSFforArduino/src +lib_dir = /workspaces/CRSFforArduino/src +src_dir = /workspaces/CRSFforArduino/src +test_dir = + +[env:development] +board = adafruit_metro_m4 +build_src_filter = + + + + + + + + + + + + + + + + +build_type = debug +extends = env_common_samd51 diff --git a/targets/common.ini b/src/build/targets/common.ini similarity index 53% rename from targets/common.ini rename to src/build/targets/common.ini index e8e98a17..2c3a2a3d 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> - +<../examples/platformio/main.cpp> - +<*/*/*.cpp> - +<*.cpp> +build_src_filter = + + + + + + + + + + + + + + + + + ; -<../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 73% rename from targets/quality_control.ini rename to src/build/targets/quality_control.ini index a0e75e39..2db569a7 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 = - +<../examples/platformio/main.cpp> - +<*/*/*.cpp> - +<*.cpp> +build_src_filter = + + + + + + + + + + + + + + + + + ; +<../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 From 4d90014ef69dda5b927d0bf228facb716a235fbf Mon Sep 17 00:00:00 2001 From: "Cassandra \"ZZ Cat\" Robinson" Date: Sat, 30 Aug 2025 12:08:52 +1200 Subject: [PATCH 10/14] =?UTF-8?q?fix(platformio):=20=F0=9F=90=9B=20Use=20r?= =?UTF-8?q?elative=20paths=20instead=20of=20absolute=20paths=20(#157)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When I initially containerised CFA, I had the hare-brained idea of using absolute paths in CFA's configuration files. Turns out, this led to obscure permission denial errors whenever I tried to run both PlatformIO commands or CFA's `build.py` script as a part of the QC and QL workflows. This resolves the broken QC and QL workflows. Everything should run as expected now. --- .github/workflows/codeql.yml | 4 ++- .github/workflows/quality_control.yml | 4 ++- library.json | 2 +- library.properties | 2 +- src/CFA_Config.hpp | 12 ++++---- src/build/scripts/platformio.ini | 44 +++++++++++++-------------- src/build/targets/common.ini | 16 +++++----- src/build/targets/quality_control.ini | 16 +++++----- 8 files changed, 52 insertions(+), 48 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index bf23cc5f..ef4c02e6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -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 e08a92c2..b4577c58 100644 --- a/.github/workflows/quality_control.yml +++ b/.github/workflows/quality_control.yml @@ -43,4 +43,6 @@ jobs: - name: Install PlatformIO run: pip install --upgrade platformio - name: Run Quality Control script - run: cd src/build/scripts && python build.py --build-on-compatible-devices + run: | + cd src/build/scripts + python build.py --build-on-compatible-devices diff --git a/library.json b/library.json index 9dfd96e2..ab23ec48 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.1.0-1.0.0", + "version": "1.1.0-2025.8.30", "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 648bedb0..d48b0d96 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=CRSFforArduino -version=1.1.0-1.0.0 +version=1.1.0-2025.8.30 author=Cassandra Robinson maintainer=Cassandra Robinson sentence=CRSF for Arduino brings the Crossfire Protocol to the Arduino ecosystem. diff --git a/src/CFA_Config.hpp b/src/CFA_Config.hpp index 2c6425f9..16031a20 100644 --- a/src/CFA_Config.hpp +++ b/src/CFA_Config.hpp @@ -35,7 +35,7 @@ namespace crsfForArduinoConfig Versioning is done using Semantic Versioning 2.0.0. See https://semver.org/ for more information. */ #define CRSFFORARDUINO_VERSION "1.1.0" -#define CRSFFORARDUINO_VERSION_DATE "2024-7-21" +#define CRSFFORARDUINO_VERSION_DATE "2025-08-30" #define CRSFFORARDUINO_VERSION_MAJOR 1 #define CRSFFORARDUINO_VERSION_MINOR 1 #define CRSFFORARDUINO_VERSION_PATCH 0 @@ -46,11 +46,11 @@ See https://semver.org/ for more information. */ // 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 "1.0.0" -#define CRSFFORARDUINO_VERSION_BUILD_DATE "2024-7-21" -#define CRSFFORARDUINO_VERSION_BUILD_MAJOR 1 -#define CRSFFORARDUINO_VERSION_BUILD_MINOR 0 -#define CRSFFORARDUINO_VERSION_BUILD_PATCH 0 +#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 diff --git a/src/build/scripts/platformio.ini b/src/build/scripts/platformio.ini index 336bae04..33065b45 100644 --- a/src/build/scripts/platformio.ini +++ b/src/build/scripts/platformio.ini @@ -9,37 +9,37 @@ ; https://docs.platformio.org/page/projectconf.html [platformio] -core_dir = /workspaces/CRSFforArduino/.pio/core -workspace_dir = /workspaces/CRSFforArduino/.pio +core_dir = ../../../.pio/core +workspace_dir = ../../../.pio default_envs = ; defect_detector ; development ${build.commonly_used} extra_configs = - /workspaces/CRSFforArduino/src/build/targets/common.ini - /workspaces/CRSFforArduino/src/build/targets/quality_control.ini - /workspaces/CRSFforArduino/src/build/targets/unified_esp32.ini - /workspaces/CRSFforArduino/src/build/targets/unified_rp2040.ini - /workspaces/CRSFforArduino/src/build/targets/unified_samd21.ini - /workspaces/CRSFforArduino/src/build/targets/unified_samd51.ini - /workspaces/CRSFforArduino/src/build/targets/unified_stm32.ini - /workspaces/CRSFforArduino/src/build/targets/unified_teensy3x.ini - /workspaces/CRSFforArduino/src/build/targets/unified_teensy4x.ini -include_dir = /workspaces/CRSFforArduino/src -lib_dir = /workspaces/CRSFforArduino/src -src_dir = /workspaces/CRSFforArduino/src + ../../../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/src/build/targets/common.ini b/src/build/targets/common.ini index 2c3a2a3d..3d155809 100644 --- a/src/build/targets/common.ini +++ b/src/build/targets/common.ini @@ -37,14 +37,14 @@ platform = teensy@4.18.0 [env] framework = arduino build_src_filter = - + - + - + - + - + - + - + - + + +<../examples/platformio/main.cpp> + + + + + + + + + + + + + + ; -<../examples/platformio/cfa_code_test.cpp> ; +<../examples/platformio/main.cpp> ; +<*/*/*.cpp> diff --git a/src/build/targets/quality_control.ini b/src/build/targets/quality_control.ini index 2db569a7..0561debc 100644 --- a/src/build/targets/quality_control.ini +++ b/src/build/targets/quality_control.ini @@ -31,14 +31,14 @@ build_flags = -DCRSF_LINK_STATISTICS_ENABLED=1 build_src_filter = - + - + - + - + - + - + - + - + + +<../examples/platformio/main.cpp> + + + + + + + + + + + + + + ; +<../examples/platformio/main.cpp> ; +<*/*/*.cpp> ; +<*.cpp> From 9209d7c0d0f9d7818c36e4a0b1554d873bf00777 Mon Sep 17 00:00:00 2001 From: ZZ-Cat Date: Mon, 1 Sep 2025 22:46:03 +0000 Subject: [PATCH 11/14] chore(`CFA_Config.hpp`): Deprecate pre-release versioning This is a remnant of the point release system and is not relevant to CFA's new rolling release model. --- src/CFA_Config.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/CFA_Config.hpp b/src/CFA_Config.hpp index 16031a20..621eac81 100644 --- a/src/CFA_Config.hpp +++ b/src/CFA_Config.hpp @@ -41,17 +41,17 @@ See https://semver.org/ for more information. */ #define CRSFFORARDUINO_VERSION_PATCH 0 // This is set to 1 if the version is a pre-release version. -#define CRSFFORARDUINO_VERSION_IS_PRERELEASE 1 +#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 +// #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. From b930bd0305a7cb983e6dfe7d56c89124e195921d Mon Sep 17 00:00:00 2001 From: ZZ-Cat Date: Mon, 1 Sep 2025 22:51:39 +0000 Subject: [PATCH 12/14] chore(library): :bookmark: Bump version to `2025.9.2` --- library.json | 2 +- library.properties | 2 +- src/CFA_Config.hpp | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/library.json b/library.json index ab23ec48..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.1.0-2025.8.30", + "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 d48b0d96..4b5edf26 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=CRSFforArduino -version=1.1.0-2025.8.30 +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/src/CFA_Config.hpp b/src/CFA_Config.hpp index 621eac81..d67d25e8 100644 --- a/src/CFA_Config.hpp +++ b/src/CFA_Config.hpp @@ -32,13 +32,14 @@ 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.1.0" -#define CRSFFORARDUINO_VERSION_DATE "2025-08-30" -#define CRSFFORARDUINO_VERSION_MAJOR 1 -#define CRSFFORARDUINO_VERSION_MINOR 1 -#define CRSFFORARDUINO_VERSION_PATCH 0 +#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 From 1947d03ebb56c6871f7f1cd24eec3dd2272ed1af Mon Sep 17 00:00:00 2001 From: ZZ-Cat Date: Mon, 1 Sep 2025 23:07:51 +0000 Subject: [PATCH 13/14] ci(quality control): :fire: Remove `Version-1.1.0-Development` from `push` and `pull_request` events --- .github/workflows/codeql.yml | 4 ++-- .github/workflows/quality_control.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ef4c02e6..c041dc59 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' diff --git a/.github/workflows/quality_control.yml b/.github/workflows/quality_control.yml index b4577c58..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 From 20695fc478eb66362d437d94599a160f19f17a59 Mon Sep 17 00:00:00 2001 From: ZZ-Cat Date: Mon, 1 Sep 2025 23:10:23 +0000 Subject: [PATCH 14/14] ci(quality control): Add Python to the Vulnerability Scanner's language matrix Because I am scripting CFA's Quality Control using Python, it's fair to check the scripts for any nasties too. =^/.~= --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c041dc59..2783b454 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -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