-
Notifications
You must be signed in to change notification settings - Fork 27
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
chore(library): Restructure entire repository #46
Merged
Conversation
This file contains 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
ZZ-Cat
added
🚨 Blocks Release 🚨
No release is to be made, until this is resolved.
Arduino IDE ♾️
This is specific to the Arduino IDE
PlatformIO 👽
This is specific to PlatformIO.
...in progress 🚧
Development on this is in progress
labels
Oct 24, 2023
6 tasks
This should help associate every header file to C++.
…ROJECT_DIR` as the root directory This allows me to put files and folders wherever I want in CRSF for Arduino.
…he `platformio` subfolder in `examples` folder
For now, CRSF for Arduino will not compile in the Arduino IDE. This is being worked on, and will be fixed in the next commit.
…rs for Arduino IDE.
… DMA enabled Currently, DMA is _highly_ experimental and its current implementation may not function as it's expected to... yet.
… Sketches` section
This provides a more concise description of what CRSF for Arduino is, and what the Crossfire Protocol is.
… Studio Code & PlatformIO` section These are more concise
…ction Explicitly specifying the development board in the command line is the preferred option.
…nt boards` section
…ection for clarity
…` list of `Do's & don'ts of CRSF for Arduino`
…ates" The Issue Templates are now the only choices, when submitting Issues.
…h "Submit an Issue" hyperlink
… Guidelines This defines what 'ghosting' is and how it is dealt with.
… the Main-Trunk` section
Just taking care of a minor bug-bear of mine. I no longer use ampersands in my written work.
This saves me from having to add this label manually, when someone submits an issue.
…sues and pull requests.
…after seven days from being slated for closure.
These are now more concise.
…ied files, based on their vendors and chipsets
ZZ-Cat
removed
...in progress 🚧
Development on this is in progress
🚨 Blocks Release 🚨
No release is to be made, until this is resolved.
labels
Oct 31, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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
This will take some time to complete.
When I first started CRSF for Arduino, I had to learn how to use PlatformIO. At the same time, I decided to make a project that integrates with PlatformIO and the Arduino IDE, and have it interoperate between both environments. I also wanted to make the project cool and interesting. Thus, CRSF for Arduino was born.
Fast forward a few months, and I have learned a lot. I now know how to properly configure PlatformIO to suit my own needs and my projects.
Now, the time has come to clean up CRSF for Arduino's janky mess that is its folder structure.
To-Do List
*.h
file extensions in CRSF for Arduino to*.hpp
.README.md
to be more concise.platformio.ini
configuration file.*.ini
file.platformio.ini
file only to decide how the environment should compile (EG "Production", "Debug" etc).The problem
CRSF for Arduino's folder structure looks like this:
This is far from ideal, because one must go through folder after folder in order to get to anything.
This has implications for some compilers (for different targets) where the linkers freak out whenever a nested structure like this exists. The Arduino IDE is infamous for also completely losing its shit over nested folder structures. Especially one that is as unnecessarily complex as CRSF for Arduino.
It also makes it harder for yours truly to debug.
Plus, it makes it harder for you guys to find anything and read CRSF for Arduino's code base.
To drive the point home, here is a screenshot of the folder structure of another project of mine:
As you can see, despite there being more modules in the project, each folder structure is straightforward and everything is easily accessible.
Even the folder structure for all of my drivers in this project is way more accessible than what I have with CRSF for Arduino:
What I want to achieve
A streamlined folder structure similar to the examples above, that retains compatibility with both the Arduino IDE and PlatformIO.
IIRC, the Arduino IDE prefers a folder structure that looks like this:
I cannot guarantee that CRSF for Arduino will look exactly like this, however I will do all I can to streamline the folder structure.
Keep in mind that this may introduce breaking changes (of which I will list here, as and when they arise).
Additional
I keep referencing PlatformIO because it is now my IDE of choice. CRSF for Arduino is developed in PlatformIO, with Visual Studio Code being my code viewer and editor.
I am also aware that Linguist (GitHub's coding language detection software) has done this:
This is incorrect, because CRSF for Arduino is written exclusively in C++.
When I click on the 'C' component, I get this:
This is CRSF for Arduino's boiler plate. 😆
Hardly C (or any language at all).
This has come about because all of CRSF for Arduino's header files are
*.h
(which is a C extension) and not*.hpp
(which is a C++ extension).I have found out that it is bad practice to mix-and-match these headers, if it contains pure C++ code (which CRSF for Arduino does).
So, one of the first things I am doing with the restructure is changing the extensions in all of CRSF for Arduino's header files from
*.h
to*.hpp
, and (hopefully) linguist will give a more accurate portrayal of the language that CRSF for Arduino is written in.