Compiling without the Arduino IDE #757
Replies: 1 comment
-
|
I am in favor, but partially it's because I'm fairly familiar with C++. If anything the way Arduino does things (making function prototypes for you and concat-ing everything) is alien to me. Another Con of doing it the "C++ way" is that there's a chance that GCC 7 (because that's what the Arduino IDE ships with apparently) may miss some optimizations that it could do when inspecting the entire program as a single file (LTO back in GCC 7 was fine... but not great still, so it won't be able to fully make up for it). Unfortunately, with my own testing trying to use GCC 14 avr-gcc actually leads to an increase in both program-size and global storage size (which is a little weird), so upgrading GCC isn't a clear option for improving LTO performance. However, I still think switching to a more "traditional" approach is better. If left to me I'd even throw in some OS (e.g. FreeRTOS), but that's probably one step too far for the community as a whole. One software development plus of going through this conversion is that it'd force thinking more deeply about all of the inter-dependencies in the code. From a cursory read of a lot of modules, for example, there are some global variables that would be better served as local temporary stack variables that only exist for the duration of a short function, instead of forever. Also, the process of separating the code might make it easier to split the UI code from the model/control code. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any interest in being able to compile the firmware with a Makefile?
Pros
Cart_Reader.ino..inosource files and combines them into 1 large.cppfile. Compiling them individually provides a way to guess flash usage before linking.Cons
Thoughts? I've played around with it a bit, and it's... interesting...

Beta Was this translation helpful? Give feedback.
All reactions