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