Proper Way to store/read EEPROM value
What's the proper way to store/read EEPROM value.
I have declared my offset in EEPROM.h as LALALA 1048 which is available.
I'm using HAL::eprSetByte( LALALA, 1 ) and HAL::eprGetByte( LALALA ) to write and read.
Do i have to do something more ?
I have declared my offset in EEPROM.h as LALALA 1048 which is available.
I'm using HAL::eprSetByte( LALALA, 1 ) and HAL::eprGetByte( LALALA ) to write and read.
Do i have to do something more ?
Comments
Type byte
Position 1048
Value 1
And when i'm trying to read by this way :
if( HAL::eprGetByte(EPR_BED_CALIBRATION_OK) == 0 ) { ... }
no luck. It never jumps into if statement
My target is to start a calibration wizard only on the first boot, and then never again.
void EEPROM::writeSettings()
a write for your position. Then you see the value and can set it to 0 with eeprom editor.
if( HAL::eprGetByte(1048) == 0 ) { ... } is checked at the first boot before the wizard takes place. And it has to be true.
As the wizard is finished i do GCode::executeFString(PSTR("M206 T0 P1048 S1")); to mark that first boot wizard has been completed.
But on the very first boot it never jumps into the above if as it's supposed. All unused bytes in EEprom are zero right ?