fix(platformio): CRSF for Arduino not recognised as a dependency#77
Merged
ZZ-Cat merged 30 commits intoMain-Trunkfrom Feb 5, 2024
Merged
fix(platformio): CRSF for Arduino not recognised as a dependency#77ZZ-Cat merged 30 commits intoMain-Trunkfrom
ZZ-Cat merged 30 commits intoMain-Trunkfrom
Conversation
The current file-and-folder structure has proven itself to be problematic when CRSF for Arduino is used as a PlatformIO dependency. This marks the beginning of a re-write of the entire file-and-folder structure to improve compatibility with PlatformIO whilst maintaining compatibility with the Arduino IDE. While efforts are underway to minimise the possibility of CRSF for Arduino's functionality being broken, there are no guarantees that this re-factor will not introduce any broken code.
So far, all of CRSF for Arduino's functionality is temporarily disabled while I rearrange all of its source files.
1 task
…ing `ARDUINO` and `PLATFORMIO` flags to decide how certain file paths should be included This seems to be what broke compatibility with PlatformIO and the Arduino IDE.
TIL: Dynamic memory doesn't return null pointers, even when `new(nothrow)` is used in place of `new`.
Functionality is _yet_ to be reinstated
Functionality is _yet_ to be reinstated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
#76 has sparked a much needed reshuffle of CRSF for Arduino's file directory to ensure it is fully compatible with PlatformIO, especially when CRSF for Arduino is used as a dependency.
Details
CRSF for Arduino's layout is standardised with the latest Arduino Library Specifications, making it fully compatible with both the Arduino IDE and PlatformIO.
In PlatformIO's case, CRSF for Arduino can be used as a dependency for your project.
To do this, simply add
https://github.com/ZZ-Cat/CRSFforArduino.git @^1.0.0to yourlib_depsin yourplatformio.iniconfiguration file.Additional notes
I did a little local "end user" PlatformIO project on my end to see exactly what is going on when CRSF for Arduino is used as a dependency, and BOY WAS THIS AN EYE OPENER!!!
As it turns out, relying on both the
ARDUINOandPLATFORMIOflags wasn't all I thought it was cracked up to be.Instead, CRSF for Arduino defines a
CFA_DEVELOPMENT_MODEflag in itsplatformio.iniconfiguration file.This flag is automatically defined on my end (because I'm CRSF for Arduino's primary developer), and CRSF for Arduino compiles with impunity. This should work well for those that want to contribute to my project in the future.