Closed ZZ-Cat closed 7 months ago
Ugh! =-/.(\=
A bug on Adafruit's end has tripped my continuous integration for testing CRSF for Arduino on supported Arduino platforms.
I am actually thinking about disabling it entirely, because it actually no longer compile-tests on the platforms that CRSF for Arduino is currently compatible with. It only compile-tests for the Metro M4 Express. CRSF for Arduino supports a more diverse range of targets now, compared to when I started this project a year or two ago.
Overview
This Pull Request is the "final touches" I need to do with the code-base before it's released.
It brings in some much needed housekeeping, and quality-of-life fixes.
Details
Deleted...
Disabled...
Fixes...
serialReceiverLayer::SerialReceiver::SerialReceiver();
Re-factors...
API changes
Flight Modes API
Both standard and custom flight modes are registered with this function:
setFlightMode(serialReceiverLayer::flightModeId_t flightModeId, const char *flightModeName, uint8_t channel, uint16_t min, uint16_t max)
flightModeId
is the same Flight Mode constants you all have been using, thus far.flightModeName
allows you to give your flight mode a name to identify it. This is particularly useful for Custom Flight Modes.channel
is your chosen channel number from1
to16
.min
is the minimum channel value (in microseconds) that will trigger this mode.max
is the maximum channel value (in microseconds) that will trigger this mode.Both standard Flight Modes and custom Flight Modes are written out using this function:
telemetryWriteFlightMode(serialReceiverLayer::flightModeId_t flightMode, bool disarmed)
flightMode
is the Flight Mode ID to pass in.disarmed
is whether-or-not you have flicked your Disarmed channel (UsuallyAux1
for ExpressLRS) or not.true
means it is disarmed.false
means it is armed.An example usage situation looks like this:
In order to use the API above, you
MUST
have the following flags set inCFA_Config.hpp
:CRSF_FLIGHTMODES_ENABLED
set to1
1
if you want access to the Custom Flight Modes integration.This is also assuming that you have
CRSF_RC_ENABLED
set to1
(which is the default, by the way. Because the entire library relies on this for everything), and you haveCRSF_TELEMETRY_ENABLED
set to1
if you want your Flight Modes to be fed back to your controller.Additional
Now that this is complete. All that is left is the documentation.
Then, CRSF for Arduino version 1.0.0 will be released to the public.
Thank you all from the bottom of my heart for being here, and using my library in your projects.
A huge thanks to those daring enough to try out CRSF for Arduino in its various stages of jankiness-to-refinement and everything in between.