Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(platformio): CRSF for Arduino not recognised as a dependency #77

Merged
merged 30 commits into from
Feb 5, 2024

Conversation

ZZ-Cat
Copy link
Owner

@ZZ-Cat ZZ-Cat commented Feb 2, 2024

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.0 to your lib_deps in your platformio.ini configuration 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 ARDUINO and PLATFORMIO flags wasn't all I thought it was cracked up to be.
Instead, CRSF for Arduino defines a CFA_DEVELOPMENT_MODE flag in its platformio.ini configuration 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.

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.
@ZZ-Cat ZZ-Cat linked an issue Feb 2, 2024 that may be closed by this pull request
1 task
@ZZ-Cat ZZ-Cat added Bug Fix 👋💥🐞 Bug meet swatter! 🚨 Blocks Release 🚨 No release is to be made, until this is resolved. Compiler 💻 This happens during compiling/building/verifying PlatformIO 👽 This is specific to PlatformIO. ...in progress 🚧 Development on this is in progress labels Feb 2, 2024
@ZZ-Cat ZZ-Cat self-assigned this Feb 2, 2024
ZZ-Cat added 21 commits February 2, 2024 14:10
…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
@ZZ-Cat ZZ-Cat marked this pull request as ready for review February 5, 2024 00:03
@ZZ-Cat ZZ-Cat added this to the Version 1.0.0 milestone Feb 5, 2024
@ZZ-Cat ZZ-Cat removed the ...in progress 🚧 Development on this is in progress label Feb 5, 2024
@ZZ-Cat ZZ-Cat merged commit ace0ed1 into Main-Trunk Feb 5, 2024
4 checks passed
@ZZ-Cat ZZ-Cat deleted the ZZ-Cat/issue76 branch February 5, 2024 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 Blocks Release 🚨 No release is to be made, until this is resolved. Bug Fix 👋💥🐞 Bug meet swatter! Compiler 💻 This happens during compiling/building/verifying PlatformIO 👽 This is specific to PlatformIO.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

No such file or directory when compiling with PlatformIO and VsCode
1 participant