Added EEPROM force clear.

- When updating from v0.8, the settings will wipe the startup lines and
build info locations so that it won’t use whatever is already there in
the EEPROM. Parameters (coord offsets) are retained. They should be ok
during an upgrade.
This commit is contained in:
Sonny Jeon 2014-08-13 21:41:46 -06:00
parent 6fdf10ba06
commit 6af010fe63
2 changed files with 11 additions and 1 deletions

View File

@ -68,6 +68,16 @@ void write_global_settings()
// Method to reset Grbl global settings back to defaults.
void settings_reset() {
// Clear startup lines and build info user data. Parameters should be ok.
// TODO: For next version, remove these clears. Only here because line buffer increased.
eeprom_put_char(EEPROM_ADDR_BUILD_INFO , 0);
#if N_STARTUP_LINE > 0
eeprom_put_char(EEPROM_ADDR_STARTUP_BLOCK, 0);
#endif
#if N_STARTUP_LINE > 1
eeprom_put_char(EEPROM_ADDR_STARTUP_BLOCK+(LINE_BUFFER_SIZE+1), 0);
#endif
settings.pulse_microseconds = DEFAULT_STEP_PULSE_MICROSECONDS;
settings.stepper_idle_lock_time = DEFAULT_STEPPER_IDLE_LOCK_TIME;
settings.step_invert_mask = DEFAULT_STEPPING_INVERT_MASK;

View File

@ -33,7 +33,7 @@
// Version of the EEPROM data. Will be used to migrate existing data from older versions of Grbl
// when firmware is upgraded. Always stored in byte 0 of eeprom
#define SETTINGS_VERSION 9
#define SETTINGS_VERSION 9 // NOTE: Check settings_reset() when moving to next version.
// Define bit flag masks for the boolean settings in settings.flag.
#define BITFLAG_REPORT_INCHES bit(0)