diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 3fcd64973..5fe1851f3 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -17,76 +17,79 @@ #define EEPROM_VERSION "V21" /** - * V19 EEPROM Layout: + * V21 EEPROM Layout: * - * ver - * M92 XYZE axis_steps_per_unit (x4) - * M203 XYZE max_feedrate (x4) - * M201 XYZE max_acceleration_units_per_sq_second (x4) - * M204 P acceleration - * M204 R retract_acceleration - * M204 T travel_acceleration - * M205 S minimumfeedrate - * M205 T mintravelfeedrate - * M205 B minsegmenttime - * M205 X max_xy_jerk - * M205 Z max_z_jerk - * M205 E max_e_jerk - * M206 XYZ home_offset (x3) + * 100 Version (char x4) + * + * 104 M92 XYZE axis_steps_per_unit (float x4) + * 120 M203 XYZE max_feedrate (float x4) + * 136 M201 XYZE max_acceleration_units_per_sq_second (uint32_t x4) + * 152 M204 P acceleration (float) + * 156 M204 R retract_acceleration (float) + * 160 M204 T travel_acceleration (float) + * 164 M205 S minimumfeedrate (float) + * 168 M205 T mintravelfeedrate (float) + * 172 M205 B minsegmenttime (ulong) + * 176 M205 X max_xy_jerk (float) + * 180 M205 Z max_z_jerk (float) + * 184 M205 E max_e_jerk (float) + * 188 M206 XYZ home_offset (float x3) * * Mesh bed leveling: - * M420 S active - * mesh_num_x (set in firmware) - * mesh_num_y (set in firmware) - * M421 XYZ z_values[][] - * M851 zprobe_zoffset + * 200 M420 S active (bool) + * 201 mesh_num_x (uint8 as set in firmware) + * 202 mesh_num_y (uint8 as set in firmware) + * 203 M421 XYZ z_values[][] (float x9, by default) + * 239 M851 zprobe_zoffset (float) * * DELTA: - * M666 XYZ endstop_adj (x3) - * M665 R delta_radius - * M665 L delta_diagonal_rod - * M665 S delta_segments_per_second + * 243 M666 XYZ endstop_adj (float x3) + * 255 M665 R delta_radius (float) + * 259 M665 L delta_diagonal_rod (float) + * 263 M665 S delta_segments_per_second (float) + * + * Z_DUAL_ENDSTOPS: + * 267 M666 Z z_endstop_adj (float) * * ULTIPANEL: - * M145 S0 H plaPreheatHotendTemp - * M145 S0 B plaPreheatHPBTemp - * M145 S0 F plaPreheatFanSpeed - * M145 S1 H absPreheatHotendTemp - * M145 S1 B absPreheatHPBTemp - * M145 S1 F absPreheatFanSpeed + * 271 M145 S0 H plaPreheatHotendTemp (int) + * 273 M145 S0 B plaPreheatHPBTemp (int) + * 275 M145 S0 F plaPreheatFanSpeed (int) + * 277 M145 S1 H absPreheatHotendTemp (int) + * 279 M145 S1 B absPreheatHPBTemp (int) + * 281 M145 S1 F absPreheatFanSpeed (int) * * PIDTEMP: - * M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] - * M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] - * M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] - * M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] - * M301 L lpq_len + * 283 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4) + * 299 M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] (float x4) + * 315 M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] (float x4) + * 331 M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4) + * 347 M301 L lpq_len (int) * * PIDTEMPBED: - * M304 PID bedKp, bedKi, bedKd + * 349 M304 PID bedKp, bedKi, bedKd (float x3) * * DOGLCD: - * M250 C lcd_contrast + * 361 M250 C lcd_contrast (int) * * SCARA: - * M365 XYZ axis_scaling (x3) + * 363 M365 XYZ axis_scaling (float x3) * * FWRETRACT: - * M209 S autoretract_enabled - * M207 S retract_length - * M207 W retract_length_swap - * M207 F retract_feedrate - * M207 Z retract_zlift - * M208 S retract_recover_length - * M208 W retract_recover_length_swap - * M208 F retract_recover_feedrate + * 375 M209 S autoretract_enabled (bool) + * 376 M207 S retract_length (float) + * 380 M207 W retract_length_swap (float) + * 384 M207 F retract_feedrate (float) + * 388 M207 Z retract_zlift (float) + * 392 M208 S retract_recover_length (float) + * 396 M208 W retract_recover_length_swap (float) + * 400 M208 F retract_recover_feedrate (float) * - * M200 D volumetric_enabled (D>0 makes this enabled) + * Volumetric Extrusion: + * 404 M200 D volumetric_enabled (bool) + * 405 M200 T D filament_size (float x4) (T0..3) * - * M200 T D filament_size (x4) (T0..3) - * - * Z_DUAL_ENDSTOPS: - * M666 Z z_endstop_adj + * 421 This Slot is Available! * */ #include "Marlin.h" @@ -133,6 +136,10 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) { #if ENABLED(EEPROM_SETTINGS) +/** + * Store Configuration Settings - M500 + */ + void Config_StoreSettings() { float dummy = 0.0f; char ver[4] = "000"; @@ -185,10 +192,10 @@ void Config_StoreSettings() { #elif ENABLED(Z_DUAL_ENDSTOPS) EEPROM_WRITE_VAR(i, z_endstop_adj); // 1 floats dummy = 0.0f; - for (int q = 5; q--;) EEPROM_WRITE_VAR(i, dummy); + for (uint8_t q = 5; q--;) EEPROM_WRITE_VAR(i, dummy); #else dummy = 0.0f; - for (int q = 6; q--;) EEPROM_WRITE_VAR(i, dummy); + for (uint8_t q = 6; q--;) EEPROM_WRITE_VAR(i, dummy); #endif #if DISABLED(ULTIPANEL) @@ -203,7 +210,7 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, absPreheatHPBTemp); EEPROM_WRITE_VAR(i, absPreheatFanSpeed); - for (int e = 0; e < 4; e++) { + for (uint8_t e = 0; e < 4; e++) { #if ENABLED(PIDTEMP) if (e < EXTRUDERS) { @@ -223,7 +230,7 @@ void Config_StoreSettings() { dummy = DUMMY_PID_VALUE; // When read, will not change the existing value EEPROM_WRITE_VAR(i, dummy); dummy = 0.0f; - for (int q = 3; q--;) EEPROM_WRITE_VAR(i, dummy); + for (uint8_t q = 3; q--;) EEPROM_WRITE_VAR(i, dummy); } } // Extruders Loop @@ -277,7 +284,7 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, volumetric_enabled); // Save filament sizes - for (int q = 0; q < 4; q++) { + for (uint8_t q = 0; q < 4; q++) { if (q < EXTRUDERS) dummy = filament_size[q]; EEPROM_WRITE_VAR(i, dummy); } @@ -339,10 +346,10 @@ void Config_RetrieveSettings() { EEPROM_READ_VAR(i, mbl.z_values); } else { mbl.reset(); - for (int q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy); + for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy); } #else - for (int q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy); + for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy); #endif // MESH_BED_LEVELING #if DISABLED(AUTO_BED_LEVELING_FEATURE) @@ -358,10 +365,10 @@ void Config_RetrieveSettings() { #elif ENABLED(Z_DUAL_ENDSTOPS) EEPROM_READ_VAR(i, z_endstop_adj); dummy = 0.0f; - for (int q=5; q--;) EEPROM_READ_VAR(i, dummy); + for (uint8_t q=5; q--;) EEPROM_READ_VAR(i, dummy); #else dummy = 0.0f; - for (int q=6; q--;) EEPROM_READ_VAR(i, dummy); + for (uint8_t q=6; q--;) EEPROM_READ_VAR(i, dummy); #endif #if DISABLED(ULTIPANEL) @@ -377,7 +384,7 @@ void Config_RetrieveSettings() { EEPROM_READ_VAR(i, absPreheatFanSpeed); #if ENABLED(PIDTEMP) - for (int e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin + for (uint8_t e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin EEPROM_READ_VAR(i, dummy); // Kp if (e < EXTRUDERS && dummy != DUMMY_PID_VALUE) { // do not need to scale PID values as the values in EEPROM are already scaled @@ -391,12 +398,12 @@ void Config_RetrieveSettings() { #endif } else { - for (int q=3; q--;) EEPROM_READ_VAR(i, dummy); // Ki, Kd, Kc + for (uint8_t q=3; q--;) EEPROM_READ_VAR(i, dummy); // Ki, Kd, Kc } } #else // !PIDTEMP // 4 x 4 = 16 slots for PID parameters - for (int q=16; q--;) EEPROM_READ_VAR(i, dummy); // 4x Kp, Ki, Kd, Kc + for (uint8_t q=16; q--;) EEPROM_READ_VAR(i, dummy); // 4x Kp, Ki, Kd, Kc #endif // !PIDTEMP #if DISABLED(PID_ADD_EXTRUSION_RATE) @@ -415,7 +422,7 @@ void Config_RetrieveSettings() { EEPROM_READ_VAR(i, bedKd); } else { - for (int q=2; q--;) EEPROM_READ_VAR(i, dummy); // bedKi, bedKd + for (uint8_t q=2; q--;) EEPROM_READ_VAR(i, dummy); // bedKi, bedKd } #if DISABLED(HAS_LCD_CONTRAST) @@ -450,7 +457,7 @@ void Config_RetrieveSettings() { EEPROM_READ_VAR(i, volumetric_enabled); - for (int q = 0; q < 4; q++) { + for (uint8_t q = 0; q < 4; q++) { EEPROM_READ_VAR(i, dummy); if (q < EXTRUDERS) filament_size[q] = dummy; } @@ -538,7 +545,7 @@ void Config_ResetDefault() { #if ENABLED(PIDTEMP) #if ENABLED(PID_PARAMS_PER_EXTRUDER) - for (int e = 0; e < EXTRUDERS; e++) + for (uint8_t e = 0; e < EXTRUDERS; e++) #else int e = 0; UNUSED(e); // only need to write once #endif @@ -686,8 +693,8 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOPAIR(" X", (unsigned long)MESH_NUM_X_POINTS); SERIAL_ECHOPAIR(" Y", (unsigned long)MESH_NUM_Y_POINTS); SERIAL_EOL; - for (int y = 0; y < MESH_NUM_Y_POINTS; y++) { - for (int x = 0; x < MESH_NUM_X_POINTS; x++) { + for (uint8_t y = 0; y < MESH_NUM_Y_POINTS; y++) { + for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { CONFIG_ECHO_START; SERIAL_ECHOPAIR(" M421 X", mbl.get_x(x)); SERIAL_ECHOPAIR(" Y", mbl.get_y(y)); @@ -708,8 +715,10 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOPAIR(" Z", endstop_adj[Z_AXIS]); SERIAL_EOL; CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Delta settings: L=delta_diagonal_rod, R=delta_radius, S=delta_segments_per_second"); - CONFIG_ECHO_START; + if (!forReplay) { + SERIAL_ECHOLNPGM("Delta settings: L=delta_diagonal_rod, R=delta_radius, S=delta_segments_per_second"); + CONFIG_ECHO_START; + } SERIAL_ECHOPAIR(" M665 L", delta_diagonal_rod); SERIAL_ECHOPAIR(" R", delta_radius); SERIAL_ECHOPAIR(" S", delta_segments_per_second);