Pointers for variables will save you memory, both RAM and ROM.
In interrupts do not call other f()'s if at all possible,. Just set a
flag , return to main, and process. This saves a lot of stack push
and associated code need to manage the stack operations. Also
possible RAM depending on whats coded in ISR
Run simple compiler tests, I found this, over common if statement, in
one compiler, that saves ROM
Myvar = (integer == 5) ? (TRUE) : (FALSE); // Note this just example
I was desperate to get some space back in a 32K limited part, was able to
get ~ 3K back in ROM, by looking at compile and how it handled some
different forms of typing, and use of pointers everywhere. Then I promptly
added more design features and eliminated my margin
. I also examined
ASM listing from compiler to get clues of what to look for/at. Very revealing.
I did some basic stack size trials, but not (in my opinion) thorough enough,
found some bytes there. But you have to be careful, codebase may at a later time
find itself w/o enough stack space if you are not careful. There are tools out there
for some compilers that will help you evaluate that. They in general are pricey.
Regards, Dana.