Skip to content

Commit

Permalink
fix babystep compile
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 29, 2022
1 parent bc9a500 commit ee1e3f4
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@

#if ANY(BABYSTEPPING, HAS_BED_PROBE, HAS_WORKSPACE_OFFSET)
#define HAS_ZOFFSET_ITEM 1
#if !HAS_BED_PROBE && ENABLED(BABYSTEPPING)
#define JUST_BABYSTEP 1
#endif
#if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP)
#if ENABLED(BABYSTEPPING)
#include "../../../feature/babystep.h"
#if !HAS_BED_PROBE
#define JUST_BABYSTEP 1
#endif
#endif
#endif

Expand Down Expand Up @@ -1030,7 +1030,7 @@ void DWIN_Draw_Dashboard() {
DWINUI::Draw_Int(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 3, 195 + 2 * STAT_CHR_W, 384, thermalManager.fan_speed[0]);
#endif

#if HAS_ZOFFSET_ITEM
#if BOTH(BABYSTEPPING, HAS_BED_PROBE)
DWINUI::Draw_Icon(planner.leveling_active ? ICON_SetZOffset : ICON_Zoffset, 187, 416);
#endif

Expand Down Expand Up @@ -1774,7 +1774,7 @@ void DWIN_InitScreen() {
index_file = MROWS;
hash_changed = true;
last_E = 0;
DWIN_DrawStatusLine(nullptr);
DWIN_DrawStatusLine(FSTR_P(nullptr));
DWIN_Draw_Dashboard();
Goto_Main_Menu();
}
Expand Down Expand Up @@ -1996,7 +1996,8 @@ void SetHome() {
if (BABYSTEP_ALLOWED()) babystep.add_steps(Z_AXIS, step_zoffset);
#endif
}
#if EITHER(HAS_BED_PROBE, BABYSTEPPING)

#if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP)
void SetZOffset() {
babystep.accum = round(planner.settings.axis_steps_per_mm[Z_AXIS] * BABY_Z_VAR);
SetPFloatOnClick(Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, 2, ApplyZOffset, LiveZOffset);
Expand Down Expand Up @@ -2024,7 +2025,7 @@ void SetHome() {
DisableMotors();
}

#endif // HAS_ZOFFSET_ITEM
#endif // HAS_ZOFFSET_ITEM

#if HAS_PREHEAT
void DoPreheat0() { ui.preheat_all(0); }
Expand Down Expand Up @@ -2640,7 +2641,7 @@ void onDrawAutoHome(MenuItemClass* menuitem, int8_t line) {
}

#if HAS_ZOFFSET_ITEM
#if EITHER(HAS_BED_PROBE, BABYSTEPPING)
#if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP)
void onDrawZOffset(MenuItemClass* menuitem, int8_t line) {
if (HMI_IsChinese()) menuitem->SetFrame(1, 174, 164, 223, 177);
onDrawPFloat2Menu(menuitem, line);
Expand Down Expand Up @@ -2992,9 +2993,9 @@ void Draw_Prepare_Menu() {
MENU_ITEM_F(ICON_Level, MSG_AUTO_MESH, onDrawMenuItem, AutoLev);
#endif
#if HAS_ZOFFSET_ITEM
#if HAS_BED_PROBE
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
MENU_ITEM_F(ICON_SetZOffset, MSG_PROBE_WIZARD, onDrawSubMenu, Draw_ZOffsetWiz_Menu);
#elif ENABLED(BABYSTEPPING)
#elif JUST_BABYSTEP
EDIT_ITEM_F(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR);
#else
MENU_ITEM_F(ICON_SetHome, MSG_SET_HOME_OFFSETS, onDrawHomeOffset, SetHome);
Expand Down Expand Up @@ -3284,7 +3285,7 @@ void Draw_Tune_Menu() {
#if HAS_FAN
FanSpeedItem = EDIT_ITEM_F(ICON_FanSpeed, MSG_FAN_SPEED, onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]);
#endif
#if HAS_ZOFFSET_ITEM && EITHER(HAS_BED_PROBE, BABYSTEPPING)
#if HAS_ZOFFSET_ITEM && EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP)
EDIT_ITEM_F(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawZOffset, SetZOffset, &BABY_Z_VAR);
#endif
EDIT_ITEM_F(ICON_Flow, MSG_FLOW, onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]);
Expand Down Expand Up @@ -3549,7 +3550,7 @@ void Draw_Steps_Menu() {
}
#endif

#if HAS_BED_PROBE
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
void Draw_ZOffsetWiz_Menu() {
checkkey = Menu;
if (SetMenu(ZOffsetWizMenu, GET_TEXT_F(MSG_PROBE_WIZARD), 4)) {
Expand Down

0 comments on commit ee1e3f4

Please sign in to comment.