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

Split out ino file into multi files #28

Open
howard0su opened this issue Oct 9, 2020 · 6 comments
Open

Split out ino file into multi files #28

howard0su opened this issue Oct 9, 2020 · 6 comments

Comments

@howard0su
Copy link
Contributor

It is inconvenient to maintain such big file. Also this limit us to build the different firmware for the different board by default. I would suggest to do the following folder structure to organize the code instead:

src/*.h -> the main source code. We can split the code into multi .h files like cat.h, radio.h, menu.h, globals.h, lcd1602.h, si5351.h, led.h, debug.h
QCX-SSB/QCX-SSB.ino -> the build folder to build QCX-SSB firmware. This ino contains the definition and a serial of includes to include the files in src/
uSDX/uSDX.ino -> the build folder to build uSDX firmware.
uSDX_ABC/uSDX_ABC.ino -> another build for another board.

Thoughts?

@tonious
Copy link

tonious commented Oct 9, 2020

I really like this idea. I was tempted to open a PR for this myself.

@tonious
Copy link

tonious commented Oct 9, 2020

Although a smaller scale might be easier to start; break out the LCD logic into lcd.cpp / lcd.h, menu into menu.cpp / menu.h. There will probably still be quite a bit of preprocessor work involved.

@howard0su
Copy link
Contributor Author

lcd may need several files for different lcd option like 1602 and LED.

@krzysztof9nowak
Copy link

Hello,
I would like to contribute to the project. I think we can use solutions already proven in a big and popular Arduino project - Marlin 3D Printer Firmware. They are using PlatformIO, which allows for developing in a real IDE like VS Code, while still keeping the reverse compatibility with a simple Arduino IDE.

Regarding compiling for different boards, a well thought out system of header files, each providing a configuration for one type of board might be better than having multiple .ino entry points.

@jokubasver
Copy link

Hello,
I would like to contribute to the project. I think we can use solutions already proven in a big and popular Arduino project - Marlin 3D Printer Firmware. They are using PlatformIO, which allows for developing in a real IDE like VS Code, while still keeping the reverse compatibility with a simple Arduino IDE.

Regarding compiling for different boards, a well thought out system of header files, each providing a configuration for one type of board might be better than having multiple .ino entry points.

PlatformIO is a great idea, I find it much more convenient and easier to use than Arduino IDE.
And I see that you have it split out the project into multiple files: https://github.com/krzysztof9nowak/QCX-SSB/tree/feature-platformio

I haven't tried it, but I assume it works fine.

This could be a good starting point for Guido to implement this into his repo.

@W3JDR
Copy link

W3JDR commented Sep 18, 2021

I'd like to suggest that the functions related to the receiver DSP processing be seperated out. This way, someone who wants to build a variant with a different processor can do it. I think the TX stuff should be separated too, as I see the present approach as a laboratory curiosity that has limited applicability, even though it is quite clever.
Joe

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

No branches or pull requests

5 participants