MKS H43 fix, cleanup (#21485)
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
@@ -43,58 +43,45 @@
|
||||
uint16_t distanceToMove = 10;
|
||||
#endif
|
||||
|
||||
uint16_t distanceMove = 1;
|
||||
uint16_t manualMoveStep = 1;
|
||||
float distanceFilament = 10;
|
||||
uint16_t FilamentSpeed = 25;
|
||||
float ZOffset_distance = 0.1;
|
||||
float mesh_adj_distance = 0.1;
|
||||
float mesh_adj_distance = 0.01;
|
||||
float Z_distance = 0.1;
|
||||
|
||||
int16_t level_1_x_point = 20;
|
||||
int16_t level_1_y_point = 20;
|
||||
//struct { uint16_t h, m, s; } dgus_time;
|
||||
|
||||
int16_t level_2_x_point = 20;
|
||||
int16_t level_2_y_point = 20;
|
||||
//
|
||||
// Persistent settings
|
||||
//
|
||||
xy_int_t mks_corner_offsets[5]; // Initialized by settings.load()
|
||||
xyz_int_t mks_park_pos; // Initialized by settings.load()
|
||||
celsius_t mks_min_extrusion_temp; // Initialized by settings.load()
|
||||
|
||||
int16_t level_3_x_point = 20;
|
||||
int16_t level_3_y_point = 20;
|
||||
|
||||
int16_t level_4_x_point = 20;
|
||||
int16_t level_4_y_point = 20;
|
||||
int16_t level_5_x_point = X_MAX_POS / 2;
|
||||
int16_t level_5_y_point = Y_MAX_POS / 2;
|
||||
|
||||
uint16_t tim_h;
|
||||
uint16_t tim_m;
|
||||
uint16_t tim_s;
|
||||
|
||||
uint16_t x_park_pos = 20;
|
||||
uint16_t y_park_pos = 20;
|
||||
uint16_t z_park_pos = 10;
|
||||
void MKS_reset_settings() {
|
||||
constexpr xy_int_t init_dgus_level_offsets[5] = {
|
||||
{ 20, 20 }, { 20, 20 },
|
||||
{ 20, 20 }, { 20, 20 },
|
||||
{ X_CENTER, Y_CENTER }
|
||||
};
|
||||
mks_language_index = 0;
|
||||
COPY(mks_corner_offsets, init_dgus_level_offsets);
|
||||
mks_park_pos.set(20, 20, 10);
|
||||
mks_min_extrusion_temp = 0;
|
||||
}
|
||||
|
||||
xyz_pos_t position_before_pause;
|
||||
|
||||
void MKS_pause_print_move() {
|
||||
queue.exhaust();
|
||||
position_before_pause = current_position;
|
||||
do_blocking_move_to(X_MIN_POS + x_park_pos, Y_MIN_POS + y_park_pos, current_position.z + z_park_pos);
|
||||
do_blocking_move_to(X_MIN_POS + mks_park_pos.x, Y_MIN_POS + mks_park_pos.y, current_position.z + mks_park_pos.z);
|
||||
}
|
||||
|
||||
void MKS_resume_print_move() { do_blocking_move_to(position_before_pause); }
|
||||
|
||||
uint16_t min_ex_temp = 0;
|
||||
|
||||
float z_offset_add = 0;
|
||||
|
||||
#if ENABLED(SENSORLESS_HOMING)
|
||||
uint16_t tmc_x_step = 0;
|
||||
uint16_t tmc_y_step = 0;
|
||||
uint16_t tmc_z_step = 0;
|
||||
#else
|
||||
uint16_t tmc_x_step = 0;
|
||||
uint16_t tmc_y_step = 0;
|
||||
uint16_t tmc_z_step = 0;
|
||||
#endif
|
||||
xyz_int_t tmc_step; // = { 0, 0, 0 }
|
||||
|
||||
uint16_t lcd_default_light = 50;
|
||||
|
||||
@@ -525,7 +512,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
VPHELPER(VP_Y_HOME, nullptr, &ScreenHandler.HandleManualMove, nullptr),
|
||||
VPHELPER(VP_Z_HOME, nullptr, &ScreenHandler.HandleManualMove, nullptr),
|
||||
|
||||
VPHELPER(VP_MOVE_DISTANCE, &distanceMove, &ScreenHandler.GetManualMovestep, nullptr),
|
||||
VPHELPER(VP_MOVE_DISTANCE, &manualMoveStep, &ScreenHandler.GetManualMovestep, nullptr),
|
||||
|
||||
VPHELPER(VP_MOTOR_LOCK_UNLOK, nullptr, &ScreenHandler.HandleManualMove, nullptr),
|
||||
VPHELPER(VP_LEVEL_POINT, nullptr, &ScreenHandler.ManualAssistLeveling, nullptr),
|
||||
@@ -567,7 +554,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
|
||||
VPHELPER(VP_LOAD_Filament, nullptr, &ScreenHandler.MKS_FilamentLoad, nullptr),
|
||||
VPHELPER(VP_UNLOAD_Filament, nullptr, &ScreenHandler.MKS_FilamentUnLoad, nullptr),
|
||||
VPHELPER(VP_Filament_distance, &distanceFilament, &ScreenHandler.GetManualFilament, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_Filament_distance, &distanceFilament, &ScreenHandler.GetManualFilament, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>),
|
||||
VPHELPER(VP_Filament_speed, &FilamentSpeed, &ScreenHandler.GetManualFilamentSpeed, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
#endif
|
||||
#endif
|
||||
@@ -623,16 +610,16 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
VPHELPER(VP_ZPos, ¤t_position.z, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>),
|
||||
|
||||
// Level Point Set
|
||||
VPHELPER(VP_Level_Point_One_X, &level_1_x_point, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_One_Y, &level_1_y_point, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Two_X, &level_2_x_point, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Two_Y, &level_2_y_point, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Three_X, &level_3_x_point, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Three_Y, &level_3_y_point, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Four_X, &level_4_x_point, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Four_Y, &level_4_y_point, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Five_X, &level_5_x_point, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Five_Y, &level_5_y_point, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_One_X, &mks_corner_offsets[0].x, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_One_Y, &mks_corner_offsets[0].y, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Two_X, &mks_corner_offsets[1].x, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Two_Y, &mks_corner_offsets[1].y, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Three_X, &mks_corner_offsets[2].x, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Three_Y, &mks_corner_offsets[2].y, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Four_X, &mks_corner_offsets[3].x, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Four_Y, &mks_corner_offsets[3].y, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Five_X, &mks_corner_offsets[4].x, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Level_Point_Five_Y, &mks_corner_offsets[4].y, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
|
||||
// Print Progress
|
||||
VPHELPER(VP_PrintProgress_Percentage, nullptr, nullptr, ScreenHandler.DGUSLCD_SendPrintProgressToDisplay),
|
||||
@@ -679,20 +666,20 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
VPHELPER(VP_T_F_SPEED, (uint16_t *)&planner.settings.min_travel_feedrate_mm_s, ScreenHandler.HandleMin_T_F_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_ACC_SPEED, (uint16_t *)&planner.settings.acceleration, ScreenHandler.HandleAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
|
||||
VPHELPER(VP_X_PARK_POS, &x_park_pos, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Y_PARK_POS, &y_park_pos, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Z_PARK_POS, &z_park_pos, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_X_PARK_POS, &mks_park_pos.x, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Y_PARK_POS, &mks_park_pos.y, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Z_PARK_POS, &mks_park_pos.z, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_MIN_EX_T, &thermalManager.extrude_min_temp, ScreenHandler.HandleGetExMinTemp_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
|
||||
#if ENABLED(SENSORLESS_HOMING) // TMC SENSORLESS Setting
|
||||
#if AXIS_HAS_STEALTHCHOP(X)
|
||||
VPHELPER(VP_TMC_X_STEP, &tmc_x_step, ScreenHandler.TMC_ChangeConfig, ScreenHandler.DGUSLCD_SendTMCStepValue),
|
||||
VPHELPER(VP_TMC_X_STEP, &tmc_step.x, ScreenHandler.TMC_ChangeConfig, ScreenHandler.DGUSLCD_SendTMCStepValue),
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y)
|
||||
VPHELPER(VP_TMC_Y_STEP, &tmc_y_step, ScreenHandler.TMC_ChangeConfig, ScreenHandler.DGUSLCD_SendTMCStepValue),
|
||||
VPHELPER(VP_TMC_Y_STEP, &tmc_step.y, ScreenHandler.TMC_ChangeConfig, ScreenHandler.DGUSLCD_SendTMCStepValue),
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z)
|
||||
VPHELPER(VP_TMC_Z_STEP, &tmc_z_step, ScreenHandler.TMC_ChangeConfig, ScreenHandler.DGUSLCD_SendTMCStepValue),
|
||||
VPHELPER(VP_TMC_Z_STEP, &tmc_step.z, ScreenHandler.TMC_ChangeConfig, ScreenHandler.DGUSLCD_SendTMCStepValue),
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user