Skip to content
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
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"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",
"postStartCommand": "sudo groupadd -g 985 uucp || true && sudo usermod -aG uucp vscode",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -23,7 +23,7 @@
},
"runArgs": [
"--device=/dev/ttyACM0",
"--group-add=986"
"--group-add=985"
],
"mounts": [
"source=/dev/bus/usb,target=/dev/bus/usb,type=bind"
Expand Down
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": "2025.9.2",
"version": "2025.10.26",
"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=2025.9.2
version=2025.10.26
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
8 changes: 4 additions & 4 deletions src/CFA_Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ namespace crsfForArduinoConfig
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 "2025.9.2"
#define CRSFFORARDUINO_VERSION_DATE "2025-09-02"
#define CRSFFORARDUINO_VERSION "2025.10.26"
#define CRSFFORARDUINO_VERSION_DATE "2025-10-26"
#define CRSFFORARDUINO_VERSION_MAJOR 2025
#define CRSFFORARDUINO_VERSION_MINOR 9
#define CRSFFORARDUINO_VERSION_PATCH 2
#define CRSFFORARDUINO_VERSION_MINOR 10
#define CRSFFORARDUINO_VERSION_PATCH 26

// This is set to 1 if the version is a pre-release version.
#define CRSFFORARDUINO_VERSION_IS_PRERELEASE 0
Expand Down
16 changes: 16 additions & 0 deletions src/build/scripts/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
Checks:
- 'bugprone-*'
- 'cert-*'
- 'clang-diagnostic-*'
- 'clang-analyzer-*'
- 'cppcoreguidelines-*'
- 'hicpp-*'
- 'misc-*'
- 'modernize-*'
- 'performance-*'
- 'portability-*'
- 'readability-*'
HeaderFileExtensions: ['h', 'hpp']
ImplementationFileExtensions: ['c', 'cpp']
...
11 changes: 10 additions & 1 deletion src/build/scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@

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"
command = "pio check -e defect_detector_clangtidy --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)

command = "pio check -e defect_detector_cppcheck --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:
Expand Down
26 changes: 5 additions & 21 deletions src/build/scripts/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
[platformio]
core_dir = ../../../.pio/core
workspace_dir = ../../../.pio
default_envs =
; defect_detector
; development
include_dir = ../../../src
lib_dir = ../../../src
src_dir = ../../../src
test_dir = ../../../src
default_envs =
${build.commonly_used}
extra_configs =
../../../src/build/targets/common.ini
Expand All @@ -25,21 +27,3 @@ extra_configs =
../../../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>
+<CRSFforArduino.cpp>
+<hal/CompatibilityTable/CompatibilityTable.cpp>
+<SerialReceiver/SerialReceiver.cpp>
+<SerialReceiver/CRC/CRC.cpp>
+<SerialReceiver/CRSF/CRSF.cpp>
+<SerialReceiver/SerialBuffer/SerialBuffer.cpp>
+<SerialReceiver/Telemetry/Telemetry.cpp>
build_type = debug
extends = env_common_samd51
123 changes: 107 additions & 16 deletions src/build/targets/common.ini
Original file line number Diff line number Diff line change
@@ -1,41 +1,83 @@
[optimise_level]
tiny = -Oz
default = -Os
[optimisation_level]
minimal = -Oz
debug = -Og
default = -Os
fast = -O2
faster = -O3
fastest = -Ofast
here_be_dragons = -Ofast -funroll-loops
highway_to_hell = -Ofast -funroll-loops

[c_cpp_standard]
deprecated =
-std=gnu11
-std=gnu++11
stable =
-std=gnu17
-std=gnu++17
latest =
-std=gnu23
-std=gnu++23

[os_usb_port]
linux = /dev/ttyACM0
macos = ; Currently not yet supported.
windows = COM3 ; Replace with the COM port your development board is connected to.

[usb_port]
selected = ${os_usb_port.linux}

[common]
build_flags =
-DCRC_OPTIMISATION_LEVEL=0
${optimise_level.fastest}
build_flags =
; -include "Arduino.h" ; BUG: This causes builds for RP2040, and Teensy 3.x and 4.x targets to fail.
; !python git_commit_sha1_macro.py ; TO-DO: Add git commit SHA1 to CFA's Serial Monitor output.
${c_cpp_standard.stable}
${optimisation_level.fastest}
build_flags_development =
-include "Arduino.h"
; !python git_commit_sha1_macro.py ; TO-DO: Add git commit SHA1 to CFA's Serial Monitor output.
${c_cpp_standard.stable}
${optimisation_level.debug}
build_unflags =
${c_cpp_standard.deprecated}
${optimisation_level.default}

[env_common_esp32]
platform = espressif32@6.4.0
upload_port = ${usb_port.selected}

[env_common_rp2040]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
platform_packages =
maxgerhardt/framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#master
upload_port = ${usb_port.selected}

[env_common_samd21]
platform = atmelsam@8.2.0
upload_protocol = sam-ba
upload_port = ${usb_port.selected}

[env_common_samd51]
platform = atmelsam@8.2.0
platform_packages =
platformio/framework-arduino-samd-adafruit@1.10716.0
platformio/framework-cmsis@2.50400.181126
platformio/toolchain-gccarmnoneeabi@1.90301.200702
platformio/tool-clangtidy@1.190100.0
platformio/tool-cppcheck@1.21100.230717
upload_protocol = sam-ba
upload_port = ${usb_port.selected}

[env_common_stm32]
platform = ststm32@17.2.0
upload_port = ${usb_port.selected}

[env_common_teensy]
platform = teensy@4.18.0
upload_port = ${usb_port.selected}

[env]
framework = arduino
build_src_filter =
+<../examples/platformio/main.cpp>
+<CRSFforArduino.cpp>
Expand All @@ -45,11 +87,60 @@ build_src_filter =
+<SerialReceiver/CRSF/CRSF.cpp>
+<SerialReceiver/SerialBuffer/SerialBuffer.cpp>
+<SerialReceiver/Telemetry/Telemetry.cpp>
; -<../examples/platformio/cfa_code_test.cpp>
; +<../examples/platformio/main.cpp>
; +<*/*/*.cpp>
; +<*.cpp>
build_unflags =
-Os
build_flags =
${common.build_flags}
framework = arduino

; [optimise_level]
; tiny = -Oz
; default = -Os
; debug = -Og
; fast = -O2
; faster = -O3
; fastest = -Ofast
; here_be_dragons = -Ofast -funroll-loops

; [common]
; build_flags =
; -DCRC_OPTIMISATION_LEVEL=0
; ${optimise_level.fastest}

; [env_common_esp32]
; platform = espressif32@6.4.0

; [env_common_rp2040]
; platform = https://github.com/maxgerhardt/platform-raspberrypi.git
; board_build.core = earlephilhower
; board_build.filesystem_size = 0.5m
; platform_packages =
; maxgerhardt/framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#master

; [env_common_samd21]
; platform = atmelsam@8.2.0

; [env_common_samd51]
; platform = atmelsam@8.2.0

; [env_common_stm32]
; platform = ststm32@17.2.0

; [env_common_teensy]
; platform = teensy@4.18.0

; [env]
; framework = arduino
; build_src_filter =
; +<../examples/platformio/main.cpp>
; +<CRSFforArduino.cpp>
; +<hal/CompatibilityTable/CompatibilityTable.cpp>
; +<SerialReceiver/SerialReceiver.cpp>
; +<SerialReceiver/CRC/CRC.cpp>
; +<SerialReceiver/CRSF/CRSF.cpp>
; +<SerialReceiver/SerialBuffer/SerialBuffer.cpp>
; +<SerialReceiver/Telemetry/Telemetry.cpp>
; ; -<../examples/platformio/cfa_code_test.cpp>
; ; +<../examples/platformio/main.cpp>
; ; +<*/*/*.cpp>
; ; +<*.cpp>
; build_unflags =
; -Os
; build_flags =
; ${common.build_flags}
Loading