EEPROM read code grouping

This commit is contained in:
Scott Lahteine 2018-10-31 16:39:49 -05:00
parent f2adb4b9cc
commit 946cf8b453

View file

@ -1008,10 +1008,6 @@ void MarlinSettings::postprocess() {
}
else {
float dummy = 0;
#if DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(FWRETRACT) || DISABLED(FWRETRACT_AUTORETRACT) || ENABLED(NO_VOLUMETRICS)
bool dummyb;
#endif
working_crc = 0; // Init to 0. Accumulated by EEPROM_READ
_FIELD_TEST(esteppers);
@ -1023,7 +1019,7 @@ void MarlinSettings::postprocess() {
//
// Planner Motion
//
{
// Get only the number of E stepper parameters previously stored
// Any steppers added later are set to their defaults
const uint32_t def1[] = DEFAULT_MAX_ACCELERATION;
@ -1063,42 +1059,46 @@ void MarlinSettings::postprocess() {
#else
EEPROM_READ(dummy);
#endif
}
//
// Home Offset (M206)
//
{
_FIELD_TEST(home_offset);
#if !HAS_HOME_OFFSET
float home_offset[XYZ];
#endif
EEPROM_READ(home_offset);
}
//
// Hotend Offsets, if any
//
{
#if HAS_HOTEND_OFFSET
// Skip hotend 0 which must be 0
for (uint8_t e = 1; e < HOTENDS; e++)
LOOP_XYZ(i) EEPROM_READ(hotend_offset[i][e]);
#endif
}
//
// Global Leveling
//
{
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
EEPROM_READ(new_z_fade_height);
#else
EEPROM_READ(dummy);
#endif
}
//
// Mesh (Manual) Bed Leveling
//
{
uint8_t mesh_num_x, mesh_num_y;
EEPROM_READ(dummy);
EEPROM_READ_ALWAYS(mesh_num_x);
@ -1119,28 +1119,35 @@ void MarlinSettings::postprocess() {
// MBL is disabled - skip the stored data
for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummy);
#endif // MESH_BED_LEVELING
}
//
// Probe Z Offset
//
{
_FIELD_TEST(zprobe_zoffset);
#if !HAS_BED_PROBE
float zprobe_zoffset;
#endif
EEPROM_READ(zprobe_zoffset);
}
//
// Planar Bed Leveling matrix
//
{
#if ABL_PLANAR
EEPROM_READ(planner.bed_level_matrix);
#else
for (uint8_t q = 9; q--;) EEPROM_READ(dummy);
#endif
}
//
// Bilinear Auto Bed Leveling
//
{
uint8_t grid_max_x, grid_max_y;
EEPROM_READ_ALWAYS(grid_max_x); // 1 byte
EEPROM_READ_ALWAYS(grid_max_y); // 1 byte
@ -1160,34 +1167,39 @@ void MarlinSettings::postprocess() {
EEPROM_READ(bs);
for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_READ(dummy);
}
}
//
// Unified Bed Leveling active state
//
{
_FIELD_TEST(planner_leveling_active);
#if ENABLED(AUTO_BED_LEVELING_UBL)
EEPROM_READ(planner.leveling_active);
EEPROM_READ(ubl.storage_slot);
#else
uint8_t dummyui8;
EEPROM_READ(dummyb);
EEPROM_READ(dummyui8);
#endif // AUTO_BED_LEVELING_UBL
bool planner_leveling_active;
uint8_t ubl_storage_slot;
EEPROM_READ(planner_leveling_active);
EEPROM_READ(ubl_storage_slot);
#endif
}
//
// SERVO_ANGLES
//
{
#if !HAS_SERVOS || DISABLED(EDITABLE_SERVO_ANGLES)
uint16_t servo_angles[NUM_SERVOS][2];
#endif
EEPROM_READ(servo_angles);
}
//
// DELTA Geometry or Dual Endstops offsets
//
{
#if ENABLED(DELTA)
_FIELD_TEST(delta_height);
@ -1226,11 +1238,12 @@ void MarlinSettings::postprocess() {
#endif
#endif
}
//
// LCD Preheat settings
//
{
_FIELD_TEST(lcd_preheat_hotend_temp);
#if DISABLED(ULTIPANEL)
@ -1240,6 +1253,7 @@ void MarlinSettings::postprocess() {
EEPROM_READ(lcd_preheat_hotend_temp); // 2 floats
EEPROM_READ(lcd_preheat_bed_temp); // 2 floats
EEPROM_READ(lcd_preheat_fan_speed); // 2 floats
}
//
// Hotend PID