Acces and modify a constant in flash memory
I have the following trouble:
I am using a radio which needs a address and channel parameters, this is given in production phase. So I am planning to flash every board with this parameters modified each time before the board is flashed.
This parameters are loaded to the radio only the first time. Which means, after a reset the parameters should not be loaded.
So my idea is create 3 constant in code:
const uint8_t first_time = 0xff;
const uint8_t address = 0;
const uint8_t channel = 0;
My code at the beginning will ask for first time in order to recognize the 0xff value.
If(first_time == 0xff)
Then read parameters address and channel and load to radio.
Modify using half flash program the const first_time with 0 value, so the next time this process wont be execute.
The parameters address and channel will be changed by modifying the binary.
Is this viable?
