I have some embedded code that writes commands to a memory address to control a peripherial like so:
void intelStartEraseBlock(uint16_t *wordAddress) {
*wordAddress = 0x20; //block erase
*wordAddress = 0xD0; //block erase confirm
}
I suspect that the optimizer is skipping the first assignment. Is this a job for volatile? or is there a better solution...
Note: this is legacy api code, so I don't plan of refactoring much. I am looking for a 'local' fix here.