Skip to content
This repository was archived by the owner on May 4, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
10 changes: 6 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
42 changes: 9 additions & 33 deletions .github/workflows/quality_control.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,47 +26,23 @@ 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
with:
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
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -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":
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=CRSFforArduino
version=1.0.4
version=2025.9.2
author=Cassandra Robinson <nicad.heli.flier@gmail.com>
maintainer=Cassandra Robinson <nicad.heli.flier@gmail.com>
sentence=CRSF for Arduino brings the Crossfire Protocol to the Arduino ecosystem.
Expand Down
39 changes: 0 additions & 39 deletions platformio.ini

This file was deleted.

31 changes: 24 additions & 7 deletions src/CFA_Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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. */

Expand Down
31 changes: 31 additions & 0 deletions src/CRSFforArduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/CRSFforArduino.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading