OpenSprinkler › Forums › OpenSprinkler Unified Firmware › main.cpp is very big › Reply To: main.cpp is very big
It’s true that main.cpp has become quite large and we haven’t done much to optimize the code design. The main challenge is that it has many #ifdef sections to address different hardwares (for example the same function may have several implementations one for each target hardware). On the other hand, I am also worried that splitting it into different files would make it difficult for finding a specific function, and since many functions are inter-related, splitting them into different files also means they have to include the function declarations of each other, which will further increase the code size. Will see what we can do to make the code more clear in the next version. Thanks for the suggestion.