I've written a few 8bit embedded systems and the codebase I inherited and have expanded is basically 80% global variables (extern volatile), and than non-global control flags and logic variables as needed.
The end result, is that you end up with a lot void() functions to modify the global variables.
The systems run fine and the software quite readable and easy to work on, but I always have that design nag in the back of my head that I should be refactoring everything and pointer'ize the next design.
I don't have any religiosity about the memory usage aspect, the static memory is there to use as much as the heap is. It's more a question of as systems get larger, I suspect maybe the globals start to be more of a hinderance than you think? I've never gotten there in program size.
Do many of you experienced embedded software programmers use pointers extensively in your 8bits systems?
I can think of three possible use cases for using pointers in C51: linked lists (which we don't use) in this system, structs in place of independent variables and then functions with pointers to modify the strucs, maybe a double pointer if you absolutely need to modify a pointer but I can't fathom a situation in building a consumer product with an 8051 (maybe building an OS...).
I get that the functions can get re-used if you pointer'ize your code, but in one sense the functions are pretty trivial and one off in the embedded systems I've built. Very application specific stuff.
A couple of you guys who are still around C51 forum, what is your most compelling (or not compelling) use case for pointers in the code you have released?
it makes little sense to me to build new products using a highly limited platform that is both outdated and out-performed. true - in many cases - but have a look at a '51 ISR with 'using' and with a 8051f120 at 100 MHz you get less than half the response time of a 166 MHz cortex. now, of course if that ISR is to do a lot, things may reverse.
I disagree with using the '51 where it does not fit (I use cortex a lot) but the '51 should not be thrown out of the toolbox.
for a small job you can have the whole '51 project running before you get the cortex BSP done.