Skip to content

Commit

Permalink
Update Probe Offset Wizard for Color UI (MarlinFirmware#19742)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhapsodyv authored and vgadreau committed Dec 9, 2020
1 parent 7dc54e6 commit 02f47be
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Marlin/src/lcd/menu/menu_probe_offset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,20 @@ void probe_offset_wizard_menu() {
SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move_z( 0.1f); });

if ((SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) {
extern const char NUL_STR[];
SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(SHORT_MANUAL_Z_MOVE)); });
MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
char tmp[20], numstr[10];
// Determine digits needed right of decimal
const uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 :
!UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2;
sprintf_P(tmp, GET_TEXT(MSG_MOVE_Z_DIST), dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr));
char tmp[20], numstr[10];
// Determine digits needed right of decimal
const uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 :
!UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2;
sprintf_P(tmp, GET_TEXT(MSG_MOVE_Z_DIST), dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr));
#if DISABLED(HAS_GRAPHICAL_TFT)
extern const char NUL_STR[];
SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(SHORT_MANUAL_Z_MOVE)); });
MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
lcd_put_u8str(tmp);
MENU_ITEM_ADDON_END();
MENU_ITEM_ADDON_END();
#else
SUBMENU_P(tmp, []{ _goto_manual_move_z(float(SHORT_MANUAL_Z_MOVE)); });
#endif
}

ACTION_ITEM(MSG_BUTTON_DONE, []{
Expand Down

0 comments on commit 02f47be

Please sign in to comment.