Skip to content

Commit

Permalink
Fix non probe z offset adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
InsanityAutomation committed Mar 25, 2022
1 parent 912939a commit df2c936
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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),
Expand Down
19 changes: 19 additions & 0 deletions Marlin/src/lcd/extui/dgus_creality/creality_touch/PageHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,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:
Expand Down

0 comments on commit df2c936

Please sign in to comment.