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

Add folder structure #78

Merged

Conversation

lenvm
Copy link
Collaborator

@lenvm lenvm commented Nov 6, 2023

What

This pull request adds a folder structure to the Software folder.

Previously all files were added to the Software folder, without a folder hierarchy.

How

It does this by adding a src folder to the Software folder, and adding a folder structure within the src folder.

The reason for adding a src folder is found on the Arduino forum.
TL;DR: it is not possible to create a folder structure in an Arduino sketch without a src folder.

The following structure is implemented:

Software
|-- src
  |-- battery
  |-- devboard
    |-- can
    |-- debug
    |-- modbus
  |-- inverter
  |-- lib
    |-- adafruit-Adafruit_NeoPixel
    |-- eModbus-eModbus
    |-- pierremolinaro-acan2515
    |-- ThomasBarth-ESP32-CAN-Driver

The folders added for the libraries correspond to the name of the GitHub hosts and name of the GitHub repository where the files were taken from.

Why

The changes done in this pull request intend to do the following:

  • make clear which are the main files that the user may interact with: Software.ino and USER_SETTINGS.h. This is achieved by only leaving these files outside the src folder.
  • make clear which file has which purpose, for instance, previously you may have asked "is BYD-CAN.h used to describe a battery or an inverter?" Now it is immediately clear from the folder structure that BYD-CAN.h is included as an inverter file.
  • make clear which files are taken from existing libraries. This should also allow easier updating of the libraries in case new releases of these libraries become available. This may be further simplified in the future by including these libraries as git submodules.
  • make clear what kind of file is included using #include. Adding a folder structure and updating the #include statements accordingly, indirectly documents what kind of file (e.g. a file from a library, or a file specific to this development board) is included.

Note

In case any changes are needed to the folder structure proposed, please let me know, then I will update this pull request accordingly.

@lenvm lenvm force-pushed the feature/add-src-folder-structure branch from a5f2d99 to 3d0a1c4 Compare November 6, 2023 20:16
Copy link
Owner

@dalathegreat dalathegreat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! I thought it wasn't possible to have a folder structure with the Arduino IDE, but you got it working! 🥇 Highly approved, thank you! This will make it so much easier for the users!

@dalathegreat dalathegreat merged commit 3818d0b into dalathegreat:main Nov 7, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants