Fix non probe z offset adjustment

This commit is contained in:
InsanityAutomation
2022-03-25 14:05:35 -04:00
parent 10fd6df83d
commit 123086d14c
2 changed files with 21 additions and 2 deletions
@@ -86,7 +86,7 @@ const char MarlinVersion[] PROGMEM = SHORT_BUILD_VERSION;
#define VPList_HeatBed
#endif
#define VPList_Common VP_BACK_BUTTON_STATE, VP_Z_OFFSET
#define VPList_Common VP_BACK_BUTTON_STATE, VP_Z_OFFSET, VP_BUTTON_BEDLEVELKEY
#define VPList_CommonWithStatus VPList_HeatHotend VPList_HeatBed VP_Z_OFFSET, VP_Feedrate_Percentage, VP_BACK_BUTTON_STATE
#define VPList_CommonWithHeatOnly VPList_HeatHotend VPList_HeatBed VP_BACK_BUTTON_STATE, VP_Z_OFFSET
@@ -628,7 +628,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
#elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
VPHELPER(VP_Z_OFFSET, nullptr, ScreenHandler.HandleZoffsetChange, nullptr),
#endif
VPHELPER(VP_FAN_TOGGLE, &thermalManager.fan_speed[0], nullptr, ScreenHandler.DGUSLCD_SendFanStatusToDisplay),
VPHELPER(VP_Fan0_Percentage, &thermalManager.fan_speed[0], ScreenHandler.HandleFanSpeedChanged, ScreenHandler.DGUSLCD_SendFanSpeedToDisplay),
@@ -220,6 +220,25 @@ void PrepareMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
void TuneMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP) {
case VP_BUTTON_BEDLEVELKEY:
switch (buttonValue) {
case 2:
// Increase Z-offset
ExtUI::smartAdjustAxis_steps(ExtUI::mmToWholeSteps(0.01, ExtUI::axis_t::Z), ExtUI::axis_t::Z, true);;
ScreenHandler.ForceCompleteUpdate();
ScreenHandler.RequestSaveSettings();
break;
case 3:
// Decrease Z-offset
ExtUI::smartAdjustAxis_steps(ExtUI::mmToWholeSteps(-0.01, ExtUI::axis_t::Z), ExtUI::axis_t::Z, true);;
ScreenHandler.ForceCompleteUpdate();
ScreenHandler.RequestSaveSettings();
break;
}
break;
case VP_BUTTON_ADJUSTENTERKEY:
switch (buttonValue) {
case 2: