|
|
@ -141,7 +141,7 @@
|
|
|
|
* 539 M200 D parser.volumetric_enabled (bool)
|
|
|
|
* 539 M200 D parser.volumetric_enabled (bool)
|
|
|
|
* 540 M200 T D planner.filament_size (float x5) (T0..3)
|
|
|
|
* 540 M200 T D planner.filament_size (float x5) (T0..3)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* HAVE_TMC2130 || HAVE_TMC2208: 22 bytes
|
|
|
|
* HAS_TRINAMIC: 22 bytes
|
|
|
|
* 560 M906 X Stepper X current (uint16_t)
|
|
|
|
* 560 M906 X Stepper X current (uint16_t)
|
|
|
|
* 562 M906 Y Stepper Y current (uint16_t)
|
|
|
|
* 562 M906 Y Stepper Y current (uint16_t)
|
|
|
|
* 564 M906 Z Stepper Z current (uint16_t)
|
|
|
|
* 564 M906 Z Stepper Z current (uint16_t)
|
|
|
@ -203,7 +203,7 @@ MarlinSettings settings;
|
|
|
|
#include "mesh_bed_leveling.h"
|
|
|
|
#include "mesh_bed_leveling.h"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
|
|
|
|
#if HAS_TRINAMIC
|
|
|
|
#include "stepper_indirection.h"
|
|
|
|
#include "stepper_indirection.h"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -283,7 +283,7 @@ void MarlinSettings::postprocess() {
|
|
|
|
bool MarlinSettings::eeprom_error;
|
|
|
|
bool MarlinSettings::eeprom_error;
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
|
|
|
int MarlinSettings::meshes_begin;
|
|
|
|
int16_t MarlinSettings::meshes_begin;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
void MarlinSettings::write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
|
|
|
|
void MarlinSettings::write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
|
|
|
@ -383,9 +383,8 @@ void MarlinSettings::postprocess() {
|
|
|
|
sizeof(mbl.z_values) == GRID_MAX_POINTS * sizeof(mbl.z_values[0][0]),
|
|
|
|
sizeof(mbl.z_values) == GRID_MAX_POINTS * sizeof(mbl.z_values[0][0]),
|
|
|
|
"MBL Z array is the wrong size."
|
|
|
|
"MBL Z array is the wrong size."
|
|
|
|
);
|
|
|
|
);
|
|
|
|
const bool leveling_is_on = mbl.has_mesh;
|
|
|
|
|
|
|
|
const uint8_t mesh_num_x = GRID_MAX_POINTS_X, mesh_num_y = GRID_MAX_POINTS_Y;
|
|
|
|
const uint8_t mesh_num_x = GRID_MAX_POINTS_X, mesh_num_y = GRID_MAX_POINTS_Y;
|
|
|
|
EEPROM_WRITE(leveling_is_on);
|
|
|
|
EEPROM_WRITE(mbl.has_mesh);
|
|
|
|
EEPROM_WRITE(mbl.z_offset);
|
|
|
|
EEPROM_WRITE(mbl.z_offset);
|
|
|
|
EEPROM_WRITE(mesh_num_x);
|
|
|
|
EEPROM_WRITE(mesh_num_x);
|
|
|
|
EEPROM_WRITE(mesh_num_y);
|
|
|
|
EEPROM_WRITE(mesh_num_y);
|
|
|
@ -581,7 +580,7 @@ void MarlinSettings::postprocess() {
|
|
|
|
EEPROM_WRITE(dummy);
|
|
|
|
EEPROM_WRITE(dummy);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // !NO_VOLUMETRICS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Save TMC2130 or TMC2208 Configuration, and placeholder values
|
|
|
|
// Save TMC2130 or TMC2208 Configuration, and placeholder values
|
|
|
|
uint16_t val;
|
|
|
|
uint16_t val;
|
|
|
@ -1282,7 +1281,7 @@ void MarlinSettings::postprocess() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
int MarlinSettings::calc_num_meshes() {
|
|
|
|
uint16_t MarlinSettings::calc_num_meshes() {
|
|
|
|
//obviously this will get more sophisticated once we've added an actual MAT
|
|
|
|
//obviously this will get more sophisticated once we've added an actual MAT
|
|
|
|
|
|
|
|
|
|
|
|
if (meshes_begin <= 0) return 0;
|
|
|
|
if (meshes_begin <= 0) return 0;
|
|
|
@ -1290,10 +1289,10 @@ void MarlinSettings::postprocess() {
|
|
|
|
return (meshes_end - meshes_begin) / sizeof(ubl.z_values);
|
|
|
|
return (meshes_end - meshes_begin) / sizeof(ubl.z_values);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MarlinSettings::store_mesh(int8_t slot) {
|
|
|
|
void MarlinSettings::store_mesh(const int8_t slot) {
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
|
|
|
const int a = calc_num_meshes();
|
|
|
|
const uint16_t a = calc_num_meshes();
|
|
|
|
if (!WITHIN(slot, 0, a - 1)) {
|
|
|
|
if (!WITHIN(slot, 0, a - 1)) {
|
|
|
|
#if ENABLED(EEPROM_CHITCHAT)
|
|
|
|
#if ENABLED(EEPROM_CHITCHAT)
|
|
|
|
ubl_invalid_slot(a);
|
|
|
|
ubl_invalid_slot(a);
|
|
|
@ -1323,11 +1322,11 @@ void MarlinSettings::postprocess() {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MarlinSettings::load_mesh(int8_t slot, void *into /* = 0 */) {
|
|
|
|
void MarlinSettings::load_mesh(const int8_t slot, void * const into/*=NULL*/) {
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
|
|
|
|
|
|
|
|
|
|
|
const int16_t a = settings.calc_num_meshes();
|
|
|
|
const uint16_t a = settings.calc_num_meshes();
|
|
|
|
|
|
|
|
|
|
|
|
if (!WITHIN(slot, 0, a - 1)) {
|
|
|
|
if (!WITHIN(slot, 0, a - 1)) {
|
|
|
|
#if ENABLED(EEPROM_CHITCHAT)
|
|
|
|
#if ENABLED(EEPROM_CHITCHAT)
|
|
|
@ -1385,17 +1384,13 @@ void MarlinSettings::reset() {
|
|
|
|
planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION;
|
|
|
|
planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION;
|
|
|
|
planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION;
|
|
|
|
planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION;
|
|
|
|
planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE;
|
|
|
|
planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE;
|
|
|
|
planner.min_segment_time_us = DEFAULT_MINSEGMENTTIME;
|
|
|
|
|
|
|
|
planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE;
|
|
|
|
planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE;
|
|
|
|
|
|
|
|
planner.min_segment_time_us = DEFAULT_MINSEGMENTTIME;
|
|
|
|
planner.max_jerk[X_AXIS] = DEFAULT_XJERK;
|
|
|
|
planner.max_jerk[X_AXIS] = DEFAULT_XJERK;
|
|
|
|
planner.max_jerk[Y_AXIS] = DEFAULT_YJERK;
|
|
|
|
planner.max_jerk[Y_AXIS] = DEFAULT_YJERK;
|
|
|
|
planner.max_jerk[Z_AXIS] = DEFAULT_ZJERK;
|
|
|
|
planner.max_jerk[Z_AXIS] = DEFAULT_ZJERK;
|
|
|
|
planner.max_jerk[E_AXIS] = DEFAULT_EJERK;
|
|
|
|
planner.max_jerk[E_AXIS] = DEFAULT_EJERK;
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
|
|
|
|
|
|
|
new_z_fade_height = 10.0;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_HOME_OFFSET
|
|
|
|
#if HAS_HOME_OFFSET
|
|
|
|
ZERO(home_offset);
|
|
|
|
ZERO(home_offset);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1417,7 +1412,14 @@ void MarlinSettings::reset() {
|
|
|
|
LOOP_XYZ(i) HOTEND_LOOP() hotend_offset[i][e] = tmp4[i][e];
|
|
|
|
LOOP_XYZ(i) HOTEND_LOOP() hotend_offset[i][e] = tmp4[i][e];
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Applies to all MBL and ABL
|
|
|
|
//
|
|
|
|
|
|
|
|
// Global Leveling
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
|
|
|
|
|
|
|
new_z_fade_height = 0.0;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_LEVELING
|
|
|
|
#if HAS_LEVELING
|
|
|
|
reset_bed_level();
|
|
|
|
reset_bed_level();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1478,10 +1480,6 @@ void MarlinSettings::reset() {
|
|
|
|
lcd_preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED;
|
|
|
|
lcd_preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_LCD_CONTRAST
|
|
|
|
|
|
|
|
lcd_contrast = DEFAULT_LCD_CONTRAST;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(PIDTEMP)
|
|
|
|
#if ENABLED(PIDTEMP)
|
|
|
|
#if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
|
|
|
|
#if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
|
|
|
|
HOTEND_LOOP()
|
|
|
|
HOTEND_LOOP()
|
|
|
@ -1505,6 +1503,10 @@ void MarlinSettings::reset() {
|
|
|
|
thermalManager.bedKd = scalePID_d(DEFAULT_bedKd);
|
|
|
|
thermalManager.bedKd = scalePID_d(DEFAULT_bedKd);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_LCD_CONTRAST
|
|
|
|
|
|
|
|
lcd_contrast = DEFAULT_LCD_CONTRAST;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(FWRETRACT)
|
|
|
|
#if ENABLED(FWRETRACT)
|
|
|
|
autoretract_enabled = false;
|
|
|
|
autoretract_enabled = false;
|
|
|
|
retract_length = RETRACT_LENGTH;
|
|
|
|
retract_length = RETRACT_LENGTH;
|
|
|
@ -1599,10 +1601,6 @@ void MarlinSettings::reset() {
|
|
|
|
stepper.digipot_current(q, (stepper.motor_current_setting[q] = tmp_motor_current_setting[q]));
|
|
|
|
stepper.digipot_current(q, (stepper.motor_current_setting[q] = tmp_motor_current_setting[q]));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
|
|
|
|
|
|
|
ubl.reset();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SKEW_CORRECTION_GCODE)
|
|
|
|
#if ENABLED(SKEW_CORRECTION_GCODE)
|
|
|
|
planner.xy_skew_factor = XY_SKEW_FACTOR;
|
|
|
|
planner.xy_skew_factor = XY_SKEW_FACTOR;
|
|
|
|
#if ENABLED(SKEW_CORRECTION_FOR_Z)
|
|
|
|
#if ENABLED(SKEW_CORRECTION_FOR_Z)
|
|
|
@ -1710,7 +1708,7 @@ void MarlinSettings::reset() {
|
|
|
|
SERIAL_ECHOLNPGM(" M200 D0");
|
|
|
|
SERIAL_ECHOLNPGM(" M200 D0");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif // !NO_VOLUMETRICS
|
|
|
|
|
|
|
|
|
|
|
|
if (!forReplay) {
|
|
|
|
if (!forReplay) {
|
|
|
|
CONFIG_ECHO_START;
|
|
|
|
CONFIG_ECHO_START;
|
|
|
@ -2062,7 +2060,7 @@ void MarlinSettings::reset() {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* TMC2130 stepper driver current
|
|
|
|
* TMC2130 stepper driver current
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#if ENABLED(HAVE_TMC2130)
|
|
|
|
#if HAS_TRINAMIC
|
|
|
|
if (!forReplay) {
|
|
|
|
if (!forReplay) {
|
|
|
|
CONFIG_ECHO_START;
|
|
|
|
CONFIG_ECHO_START;
|
|
|
|
SERIAL_ECHOLNPGM("Stepper driver current:");
|
|
|
|
SERIAL_ECHOLNPGM("Stepper driver current:");
|
|
|
@ -2108,7 +2106,7 @@ void MarlinSettings::reset() {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* TMC2130 Sensorless homing thresholds
|
|
|
|
* TMC2130 Sensorless homing thresholds
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#if ENABLED(HAVE_TMC2130) && ENABLED(SENSORLESS_HOMING)
|
|
|
|
#if ENABLED(SENSORLESS_HOMING)
|
|
|
|
if (!forReplay) {
|
|
|
|
if (!forReplay) {
|
|
|
|
CONFIG_ECHO_START;
|
|
|
|
CONFIG_ECHO_START;
|
|
|
|
SERIAL_ECHOLNPGM("Sensorless homing threshold:");
|
|
|
|
SERIAL_ECHOLNPGM("Sensorless homing threshold:");
|
|
|
|