It's me again, playing with forces beyond my understanding
I have a function pointer:
void (*OpMode)(char);
And I have a piece of code that handles menu options like so:
switch(cmd) { case 0 : OpMode = Idle ; break ; case 1 : OpMode = SetClock ; break ; case 2 : OpMode = ViewSequence ; break ; case 3 : OpMode = ViewSchedule ; break ; }
I have in mind that this would be smaller, cleaner, and more sexy if I made an array of functions in flash so I could assign OpMode = FlashArray[cmd] or somesuch. Of course, I could be completely off my nut.
My thinking is:
void (*CommandFunction[4])(char) = {Idle, SetClock,ViewSequence, ViewSchedule};
But how do I put this to __flash? (It's already about 40 bytes smaller than the switch statement.)