It appears to be saving and loading some parameters (4 byte aligned) into one of the sectors alternatively and storing an associated flag in another sector.
My question is - Is it done to achieve wear levelling of flash memory. I ask this because the sector where flag is being stored is erased each time when we store (save) the params. Then how come this is reducing the wear? How does it differ from storing and saving the params in one sector ? Do we get any benefit
Alternatively, if there is some other functionality being achieved by this code fragment, can anyone please explain the same?