I have a piece of code that calls various function pointers in an array. These are read-only in Flash, meaning on the Cortex-M3 I am using they are always in the first 16 KB.
Is there any feature of the Keil compiler to use 16 bits for certain pointers, an attribute or similar? I'm looking to save code space. My first thought was to just have them cast to uint16_t, but I am worried that might interfere with the compiler's ability to optimize.
Yes, I can save 116 bytes of ROM. I am already indexing these in locations where it's practical. Out of 16KB it's not even 1%, but I am down to around 350 and, if possible, this seems a good way to claw back another 100ish.
I was going to say that the biggest savings come from structuring the program more efficiently, but you probably already know that...