DeclaredButNotUsed
Newbie
After spending almost half a year structuring and building a project in C++ with lots of generic libraries (no hardware related) I had to took on a new project that its requirements led me to use a PIC18F.
Soon, I found out that I could literally use nothing out of the box. I couldn't compile anything that was in C++ and the most important stuff was in C++.
I know that it's just a single example but it was a nightmare having to re-write almost everything. I had to extract my classes' methods, put them in h/c files and create new modules. Fortunately my cmake build system did help me a lot for that. But I ended up with a bunch of code duplication. Yes I know I can use those c implemented modules inside my classes now for my other projects but that requires testing again. It's not that simple.
Some people would ask, why did you choose such an old chip. Global semiconductor shortage forced me to do so. Also, there are occasions when a Cortex-M3 with tons of RAM isn't a good fit.
The project took a month more due to the extra work that had to be done.
This made me to reconsider.
Is C++ really suitable for embedded systems?
Why should I use C++ if I can't compile a hardware independent piece of code for every silicon out there
What would you do in that case?
Soon, I found out that I could literally use nothing out of the box. I couldn't compile anything that was in C++ and the most important stuff was in C++.
I know that it's just a single example but it was a nightmare having to re-write almost everything. I had to extract my classes' methods, put them in h/c files and create new modules. Fortunately my cmake build system did help me a lot for that. But I ended up with a bunch of code duplication. Yes I know I can use those c implemented modules inside my classes now for my other projects but that requires testing again. It's not that simple.
Some people would ask, why did you choose such an old chip. Global semiconductor shortage forced me to do so. Also, there are occasions when a Cortex-M3 with tons of RAM isn't a good fit.
The project took a month more due to the extra work that had to be done.
This made me to reconsider.
Is C++ really suitable for embedded systems?
Why should I use C++ if I can't compile a hardware independent piece of code for every silicon out there
What would you do in that case?