microReticulum_Firmware icon indicating copy to clipboard operation
microReticulum_Firmware copied to clipboard

Compilation Warnings for Macro Redefinition

Open angel523323 opened this issue 9 months ago • 1 comments

When compiling with platformio, there are significant warnings for macro redefinition. This seems intentional from upstream RNode_Firmware. If we want to ignore the errors we can use -Wno-builtin-macro-redefined.

Instead we could reorganize the way the data is defined. Such as using separate header files that define everything needed instead of in one file with many preprocessor if statements. If the hardware dependent constants/defines were separated it would make adding new devices easier.

Examples in the code These are all predefined, and later depending on the hardware redefined, as is the case with the Heltec V3 below. https://github.com/attermann/microReticulum_Firmware/blob/590d85cc04ae3b6968c9becafe16cf40a01de07e/Boards.h#L152-L165

https://github.com/attermann/microReticulum_Firmware/blob/590d85cc04ae3b6968c9becafe16cf40a01de07e/Boards.h#L349-L357

angel523323 avatar Feb 13 '26 22:02 angel523323

I completely agree and have longed for some better structure. I've resisted though due to the complexity it adds when merging upstream updates from the reference RNode_Firmware project. For now I don't want to touch it.

attermann avatar Feb 14 '26 22:02 attermann