Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn TouchControlType (TCT) into an enum class #25333

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_bed_leveling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
MenuItem_static::draw(1, GET_TEXT_F(MSG_LEVEL_BED_WAITING));
// Color UI needs a control to detect a touch
#if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT)
touch.add_control(CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT);
touch.add_control(TouchControlType::CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT);
#endif
}
if (ui.use_click()) {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_x_twist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void xatc_wizard_homing_done() {

// Color UI needs a control to detect a touch
#if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT)
touch.add_control(CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT);
touch.add_control(TouchControlType::CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT);
#endif
}

Expand Down
52 changes: 26 additions & 26 deletions Marlin/src/lcd/tft/touch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ millis_t Touch::next_touch_ms = 0,
Touch::time_to_hold,
Touch::repeat_delay,
Touch::touch_time;
TouchControlType Touch::touch_control_type = NONE;
TouchControlType Touch::touch_control_type = TouchControlType::NONE;
#if HAS_TOUCH_SLEEP
millis_t Touch::next_sleep_ms; // = 0
#endif
Expand Down Expand Up @@ -90,7 +90,7 @@ void Touch::idle() {
#if HAS_RESUME_CONTINUE
// UI is waiting for a click anywhere?
if (wait_for_user) {
touch_control_type = CLICK;
touch_control_type = TouchControlType::CLICK;
ui.lcd_clicked = true;
if (ui.external_control) wait_for_user = false;
return;
Expand All @@ -101,7 +101,7 @@ void Touch::idle() {

if (touch_time) {
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
if (touch_control_type == NONE && ELAPSED(now, touch_time + TOUCH_SCREEN_HOLD_TO_CALIBRATE_MS) && ui.on_status_screen())
if (touch_control_type == TouchControlType::NONE && ELAPSED(now, touch_time + TOUCH_SCREEN_HOLD_TO_CALIBRATE_MS) && ui.on_status_screen())
ui.goto_screen(touch_screen_calibration);
#endif
return;
Expand All @@ -124,7 +124,7 @@ void Touch::idle() {
}
else {
for (i = 0; i < controls_count; i++) {
if ((WITHIN(x, controls[i].x, controls[i].x + controls[i].width) && WITHIN(y, controls[i].y, controls[i].y + controls[i].height)) || (TERN(TOUCH_SCREEN_CALIBRATION, controls[i].type == CALIBRATE, false))) {
if ((WITHIN(x, controls[i].x, controls[i].x + controls[i].width) && WITHIN(y, controls[i].y, controls[i].y + controls[i].height)) || (TERN(TOUCH_SCREEN_CALIBRATION, controls[i].type == TouchControlType::CALIBRATE, false))) {
touch_control_type = controls[i].type;
touch(&controls[i]);
break;
Expand All @@ -142,7 +142,7 @@ void Touch::idle() {
x = y = 0;
current_control = nullptr;
touch_time = 0;
touch_control_type = NONE;
touch_control_type = TouchControlType::NONE;
time_to_hold = 0;
repeat_delay = TOUCH_REPEAT_DELAY;
}
Expand All @@ -151,38 +151,38 @@ void Touch::idle() {
void Touch::touch(touch_control_t *control) {
switch (control->type) {
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
case CALIBRATE:
case TouchControlType::CALIBRATE:
if (touch_calibration.handleTouch(x, y)) ui.refresh();
break;
#endif // TOUCH_SCREEN_CALIBRATION

case MENU_SCREEN: ui.goto_screen((screenFunc_t)control->data); break;
case BACK: ui.goto_previous_screen(); break;
case MENU_CLICK:
case TouchControlType::MENU_SCREEN: ui.goto_screen((screenFunc_t)control->data); break;
case TouchControlType::BACK: ui.goto_previous_screen(); break;
case TouchControlType::MENU_CLICK:
TERN_(SINGLE_TOUCH_NAVIGATION, ui.encoderPosition = control->data);
ui.lcd_clicked = true;
break;
case CLICK: ui.lcd_clicked = true; break;
case TouchControlType::CLICK: ui.lcd_clicked = true; break;
#if HAS_RESUME_CONTINUE
case RESUME_CONTINUE: extern bool wait_for_user; wait_for_user = false; break;
case TouchControlType::RESUME_CONTINUE: extern bool wait_for_user; wait_for_user = false; break;
#endif
case CANCEL: ui.encoderPosition = 0; ui.selection = false; ui.lcd_clicked = true; break;
case CONFIRM: ui.encoderPosition = 1; ui.selection = true; ui.lcd_clicked = true; break;
case MENU_ITEM: ui.encoderPosition = control->data; ui.refresh(); break;
case PAGE_UP:
case TouchControlType::CANCEL: ui.encoderPosition = 0; ui.selection = false; ui.lcd_clicked = true; break;
case TouchControlType::CONFIRM: ui.encoderPosition = 1; ui.selection = true; ui.lcd_clicked = true; break;
case TouchControlType::MENU_ITEM: ui.encoderPosition = control->data; ui.refresh(); break;
case TouchControlType::PAGE_UP:
encoderTopLine = encoderTopLine > LCD_HEIGHT ? encoderTopLine - LCD_HEIGHT : 0;
ui.encoderPosition = ui.encoderPosition > LCD_HEIGHT ? ui.encoderPosition - LCD_HEIGHT : 0;
ui.refresh();
break;
case PAGE_DOWN:
case TouchControlType::PAGE_DOWN:
encoderTopLine = (encoderTopLine + 2 * LCD_HEIGHT < screen_items) ? encoderTopLine + LCD_HEIGHT : screen_items - LCD_HEIGHT;
ui.encoderPosition = ui.encoderPosition + LCD_HEIGHT < (uint32_t)screen_items ? ui.encoderPosition + LCD_HEIGHT : screen_items;
ui.refresh();
break;
case SLIDER: hold(control); ui.encoderPosition = (x - control->x) * control->data / control->width; break;
case INCREASE: hold(control, repeat_delay - 5); TERN(AUTO_BED_LEVELING_UBL, ui.external_control ? bedlevel.encoder_diff++ : ui.encoderPosition++, ui.encoderPosition++); break;
case DECREASE: hold(control, repeat_delay - 5); TERN(AUTO_BED_LEVELING_UBL, ui.external_control ? bedlevel.encoder_diff-- : ui.encoderPosition--, ui.encoderPosition--); break;
case HEATER:
case TouchControlType::SLIDER: hold(control); ui.encoderPosition = (x - control->x) * control->data / control->width; break;
case TouchControlType::INCREASE: hold(control, repeat_delay - 5); TERN(AUTO_BED_LEVELING_UBL, ui.external_control ? bedlevel.encoder_diff++ : ui.encoderPosition++, ui.encoderPosition++); break;
case TouchControlType::DECREASE: hold(control, repeat_delay - 5); TERN(AUTO_BED_LEVELING_UBL, ui.external_control ? bedlevel.encoder_diff-- : ui.encoderPosition--, ui.encoderPosition--); break;
case TouchControlType::HEATER:
int8_t heater;
heater = control->data;
ui.clear_lcd();
Expand Down Expand Up @@ -213,18 +213,18 @@ void Touch::touch(touch_control_t *control) {
#endif

break;
case FAN:
case TouchControlType::FAN:
ui.clear_lcd();
static uint8_t fan, fan_speed;
fan = 0;
fan_speed = thermalManager.fan_speed[fan];
MenuItem_percent::action(GET_TEXT_F(MSG_FIRST_FAN_SPEED), &fan_speed, 0, 255, []{ thermalManager.set_fan_speed(fan, fan_speed); });
break;
case FEEDRATE:
case TouchControlType::FEEDRATE:
ui.clear_lcd();
MenuItem_int3::action(GET_TEXT_F(MSG_SPEED), &feedrate_percentage, 10, 999);
break;
case FLOWRATE:
case TouchControlType::FLOWRATE:
ui.clear_lcd();
MenuItemBase::itemIndex = control->data;
#if EXTRUDERS == 1
Expand All @@ -235,15 +235,15 @@ void Touch::touch(touch_control_t *control) {
break;

#if ENABLED(AUTO_BED_LEVELING_UBL)
case UBL: hold(control, UBL_REPEAT_DELAY); ui.encoderPosition += control->data; break;
case TouchControlType::UBL: hold(control, UBL_REPEAT_DELAY); ui.encoderPosition += control->data; break;
#endif

case MOVE_AXIS:
case TouchControlType::MOVE_AXIS:
ui.goto_screen((screenFunc_t)ui.move_axis_screen);
break;

// TODO: TOUCH could receive data to pass to the callback
case BUTTON: ((screenFunc_t)control->data)(); break;
case TouchControlType::BUTTON: ((screenFunc_t)control->data)(); break;

default: break;
}
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/tft/touch.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// Menu Navigation
extern int8_t encoderTopLine, encoderLine, screen_items;

enum TouchControlType : uint16_t {
enum class TouchControlType : uint16_t {
NONE = 0x0000,
CALIBRATE,
MENU_SCREEN,
Expand Down Expand Up @@ -72,7 +72,7 @@ typedef void (*screenFunc_t)();

void add_control(uint16_t x, uint16_t y, TouchControlType control_type, intptr_t data, MarlinImage image, bool is_enabled = true, uint16_t color_enabled = COLOR_CONTROL_ENABLED, uint16_t color_disabled = COLOR_CONTROL_DISABLED);
inline void add_control(uint16_t x, uint16_t y, TouchControlType control_type, MarlinImage image, bool is_enabled = true, uint16_t color_enabled = COLOR_CONTROL_ENABLED, uint16_t color_disabled = COLOR_CONTROL_DISABLED) { add_control(x, y, control_type, 0, image, is_enabled, color_enabled, color_disabled); }
inline void add_control(uint16_t x, uint16_t y, screenFunc_t screen, MarlinImage image, bool is_enabled = true, uint16_t color_enabled = COLOR_CONTROL_ENABLED, uint16_t color_disabled = COLOR_CONTROL_DISABLED) { add_control(x, y, MENU_SCREEN, (intptr_t)screen, image, is_enabled, color_enabled, color_disabled); }
inline void add_control(uint16_t x, uint16_t y, screenFunc_t screen, MarlinImage image, bool is_enabled = true, uint16_t color_enabled = COLOR_CONTROL_ENABLED, uint16_t color_disabled = COLOR_CONTROL_DISABLED) { add_control(x, y, TouchControlType::MENU_SCREEN, (intptr_t)screen, image, is_enabled, color_enabled, color_disabled); }

typedef struct __attribute__((__packed__)) {
TouchControlType type;
Expand Down Expand Up @@ -116,8 +116,8 @@ class Touch {
static void clear() { controls_count = 0; }
static void idle();
static bool is_clicked() {
if (touch_control_type == CLICK) {
touch_control_type = NONE;
if (touch_control_type == TouchControlType::CLICK) {
touch_control_type = TouchControlType::NONE;
return true;
}
return false;
Expand Down
54 changes: 27 additions & 27 deletions Marlin/src/lcd/tft/ui_1024x600.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ void MarlinUI::tft_idle() {
#if ENABLED(TOUCH_SCREEN)
if (TERN0(HAS_TOUCH_SLEEP, lcd_sleep_task())) return;
if (draw_menu_navigation) {
add_control(164, TFT_HEIGHT - 50, PAGE_UP, imgPageUp, encoderTopLine > 0);
add_control(796, TFT_HEIGHT - 50, PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items);
add_control(480, TFT_HEIGHT - 50, BACK, imgBack);
add_control(164, TFT_HEIGHT - 50, TouchControlType::PAGE_UP, imgPageUp, encoderTopLine > 0);
add_control(796, TFT_HEIGHT - 50, TouchControlType::PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items);
add_control(480, TFT_HEIGHT - 50, TouchControlType::BACK, imgBack);
draw_menu_navigation = false;
}
#endif
Expand Down Expand Up @@ -151,7 +151,7 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) {
#endif
else return;

TERN_(TOUCH_SCREEN, if (targetTemperature >= 0) touch.add_control(HEATER, x, y, 80, 120, Heater));
TERN_(TOUCH_SCREEN, if (targetTemperature >= 0) touch.add_control(TouchControlType::HEATER, x, y, 80, 120, Heater));
tft.canvas(x, y, 80, 120);
tft.set_background(COLOR_BACKGROUND);

Expand Down Expand Up @@ -196,7 +196,7 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) {
}

void draw_fan_status(uint16_t x, uint16_t y, const bool blink) {
TERN_(TOUCH_SCREEN, touch.add_control(FAN, x, y, 80, 120));
TERN_(TOUCH_SCREEN, touch.add_control(TouchControlType::FAN, x, y, 80, 120));
tft.canvas(x, y, 80, 120);
tft.set_background(COLOR_BACKGROUND);

Expand Down Expand Up @@ -301,7 +301,7 @@ void MarlinUI::draw_status_screen() {
offset -= tft_string.width();
}
tft.add_text(900 - tft_string.width() - offset, 3, nhz ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string);
TERN_(TOUCH_SCREEN, touch.add_control(MOVE_AXIS, 4, y, TFT_WIDTH - 8, FONT_LINE_HEIGHT));
TERN_(TOUCH_SCREEN, touch.add_control(TouchControlType::MOVE_AXIS, 4, y, TFT_WIDTH - 8, FONT_LINE_HEIGHT));

y += 100;
// feed rate
Expand All @@ -312,7 +312,7 @@ void MarlinUI::draw_status_screen() {
tft_string.set(i16tostr3rj(feedrate_percentage));
tft_string.add('%');
tft.add_text(36, 1, color , tft_string);
TERN_(TOUCH_SCREEN, touch.add_control(FEEDRATE, 274, y, 128, 32));
TERN_(TOUCH_SCREEN, touch.add_control(TouchControlType::FEEDRATE, 274, y, 128, 32));

// flow rate
tft.canvas(650, y, 128, 32);
Expand All @@ -322,7 +322,7 @@ void MarlinUI::draw_status_screen() {
tft_string.set(i16tostr3rj(planner.flow_percentage[active_extruder]));
tft_string.add('%');
tft.add_text(36, 1, color , tft_string);
TERN_(TOUCH_SCREEN, touch.add_control(FLOWRATE, 650, y, 128, 32, active_extruder));
TERN_(TOUCH_SCREEN, touch.add_control(TouchControlType::FLOWRATE, 650, y, 128, 32, active_extruder));

#if ENABLED(TOUCH_SCREEN)
add_control(900, y, menu_main, imgSettings);
Expand Down Expand Up @@ -414,7 +414,7 @@ void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const va

#if ENABLED(TOUCH_SCREEN)
tft.add_image((SLIDER_LENGTH - 8) * ui.encoderPosition / maxEditValue, 0, imgSlider, COLOR_SLIDER);
touch.add_control(SLIDER, (TFT_WIDTH - SLIDER_LENGTH) / 2, SLIDER_Y_POSITION - 8, SLIDER_LENGTH, 32, maxEditValue);
touch.add_control(TouchControlType::SLIDER, (TFT_WIDTH - SLIDER_LENGTH) / 2, SLIDER_Y_POSITION - 8, SLIDER_LENGTH, 32, maxEditValue);
#endif
}

Expand All @@ -423,9 +423,9 @@ void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const va

void TFT::draw_edit_screen_buttons() {
#if ENABLED(TOUCH_SCREEN)
add_control(164, TFT_HEIGHT - 64, DECREASE, imgDecrease);
add_control(796, TFT_HEIGHT - 64, INCREASE, imgIncrease);
add_control(480, TFT_HEIGHT - 64, CLICK, imgConfirm);
add_control(164, TFT_HEIGHT - 64, TouchControlType::DECREASE, imgDecrease);
add_control(796, TFT_HEIGHT - 64, TouchControlType::INCREASE, imgIncrease);
add_control(480, TFT_HEIGHT - 64, TouchControlType::CLICK, imgConfirm);
#endif
}

Expand Down Expand Up @@ -454,8 +454,8 @@ void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, con
tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_MENU_TEXT, tft_string);
}
#if ENABLED(TOUCH_SCREEN)
add_control(88, TFT_HEIGHT - 64, CANCEL, imgCancel, true, yesno ? HALF(COLOR_CONTROL_CANCEL) : COLOR_CONTROL_CANCEL);
add_control(328, TFT_HEIGHT - 64, CONFIRM, imgConfirm, true, yesno ? COLOR_CONTROL_CONFIRM : HALF(COLOR_CONTROL_CONFIRM));
add_control(88, TFT_HEIGHT - 64, TouchControlType::CANCEL, imgCancel, true, yesno ? HALF(COLOR_CONTROL_CANCEL) : COLOR_CONTROL_CANCEL);
add_control(328, TFT_HEIGHT - 64, TouchControlType::CONFIRM, imgConfirm, true, yesno ? COLOR_CONTROL_CONFIRM : HALF(COLOR_CONTROL_CONFIRM));
#else
menu_line(++line);
if (no) {
Expand All @@ -478,7 +478,7 @@ void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, con
#if ENABLED(TOUCH_SCREEN)
touch.clear();
draw_menu_navigation = false;
touch.add_control(RESUME_CONTINUE , 0, 0, TFT_WIDTH, TFT_HEIGHT);
touch.add_control(TouchControlType::RESUME_CONTINUE , 0, 0, TFT_WIDTH, TFT_HEIGHT);
#endif

menu_line(row);
Expand Down Expand Up @@ -560,12 +560,12 @@ void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, con
#if ENABLED(TOUCH_SCREEN)
touch.clear();
draw_menu_navigation = false;
add_control(GRID_OFFSET_X + GRID_WIDTH + CONTROL_OFFSET, GRID_OFFSET_Y + CONTROL_OFFSET, UBL, ENCODER_STEPS_PER_MENU_ITEM * GRID_MAX_POINTS_X, imgUp);
add_control(GRID_OFFSET_X + GRID_WIDTH + CONTROL_OFFSET, GRID_OFFSET_Y + GRID_HEIGHT - CONTROL_OFFSET - 32, UBL, - ENCODER_STEPS_PER_MENU_ITEM * GRID_MAX_POINTS_X, imgDown);
add_control(GRID_OFFSET_X + CONTROL_OFFSET, GRID_OFFSET_Y + GRID_HEIGHT + CONTROL_OFFSET, UBL, - ENCODER_STEPS_PER_MENU_ITEM, imgLeft);
add_control(GRID_OFFSET_X + GRID_WIDTH - CONTROL_OFFSET - 32, GRID_OFFSET_Y + GRID_HEIGHT + CONTROL_OFFSET, UBL, ENCODER_STEPS_PER_MENU_ITEM, imgRight);
add_control(320, GRID_OFFSET_Y + GRID_HEIGHT + CONTROL_OFFSET, CLICK, imgLeveling);
add_control(224, TFT_HEIGHT - 34, BACK, imgBack);
add_control(GRID_OFFSET_X + GRID_WIDTH + CONTROL_OFFSET, GRID_OFFSET_Y + CONTROL_OFFSET, TouchControlType::UBL, ENCODER_STEPS_PER_MENU_ITEM * GRID_MAX_POINTS_X, imgUp);
add_control(GRID_OFFSET_X + GRID_WIDTH + CONTROL_OFFSET, GRID_OFFSET_Y + GRID_HEIGHT - CONTROL_OFFSET - 32, TouchControlType::UBL, - ENCODER_STEPS_PER_MENU_ITEM * GRID_MAX_POINTS_X, imgDown);
add_control(GRID_OFFSET_X + CONTROL_OFFSET, GRID_OFFSET_Y + GRID_HEIGHT + CONTROL_OFFSET, TouchControlType::UBL, - ENCODER_STEPS_PER_MENU_ITEM, imgLeft);
add_control(GRID_OFFSET_X + GRID_WIDTH - CONTROL_OFFSET - 32, GRID_OFFSET_Y + GRID_HEIGHT + CONTROL_OFFSET, TouchControlType::UBL, ENCODER_STEPS_PER_MENU_ITEM, imgRight);
add_control(320, GRID_OFFSET_Y + GRID_HEIGHT + CONTROL_OFFSET, TouchControlType::CLICK, imgLeveling);
add_control(224, TFT_HEIGHT - 34, TouchControlType::BACK, imgBack);
#endif
}
#endif // AUTO_BED_LEVELING_UBL
Expand Down Expand Up @@ -820,7 +820,7 @@ static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage
tft.add_image(0, 0, img, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY);
}

TERN_(TOUCH_SCREEN, if (enabled) touch.add_control(BUTTON, x, y, width, height, data));
TERN_(TOUCH_SCREEN, if (enabled) touch.add_control(TouchControlType::BUTTON, x, y, width, height, data));
}

void MarlinUI::move_axis_screen() {
Expand Down Expand Up @@ -865,13 +865,13 @@ void MarlinUI::move_axis_screen() {
motionAxisState.eNamePos.x = x;
motionAxisState.eNamePos.y = y;
drawCurESelection();
TERN_(TOUCH_SCREEN, if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, BTN_HEIGHT, (intptr_t)e_select));
TERN_(TOUCH_SCREEN, if (!busy) touch.add_control(TouchControlType::BUTTON, x, y, BTN_WIDTH, BTN_HEIGHT, (intptr_t)e_select));

x += BTN_WIDTH + spacing;
drawBtn(x, y, "X-", (intptr_t)x_minus, imgLeft, X_BTN_COLOR, !busy);

x += BTN_WIDTH + spacing; //imgHome is 64x64
TERN_(TOUCH_SCREEN, add_control(TFT_WIDTH / 2 - Images[imgHome].width / 2, y - (Images[imgHome].width - BTN_HEIGHT) / 2, BUTTON, (intptr_t)do_home, imgHome, !busy));
TERN_(TOUCH_SCREEN, add_control(TFT_WIDTH / 2 - Images[imgHome].width / 2, y - (Images[imgHome].width - BTN_HEIGHT) / 2, TouchControlType::BUTTON, (intptr_t)do_home, imgHome, !busy));

x += BTN_WIDTH + spacing;
uint16_t xplus_x = x;
Expand All @@ -882,7 +882,7 @@ void MarlinUI::move_axis_screen() {
motionAxisState.zTypePos.y = y;
drawCurZSelection();
#if BOTH(HAS_BED_PROBE, TOUCH_SCREEN)
if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, 34 * 2, (intptr_t)z_select);
if (!busy) touch.add_control(TouchControlType::BUTTON, x, y, BTN_WIDTH, 34 * 2, (intptr_t)z_select);
#endif

// ROW 3 -> E- CurX Y- Z-
Expand Down Expand Up @@ -920,13 +920,13 @@ void MarlinUI::move_axis_screen() {
motionAxisState.stepValuePos.y = y;
if (!busy) {
drawCurStepValue();
TERN_(TOUCH_SCREEN, touch.add_control(BUTTON, motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT, (intptr_t)step_size));
TERN_(TOUCH_SCREEN, touch.add_control(TouchControlType::BUTTON, motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT, (intptr_t)step_size));
}

// aligned with x+
drawBtn(xplus_x, TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT, "off", (intptr_t)disable_steppers, imgCancel, COLOR_WHITE, !busy);

TERN_(TOUCH_SCREEN, add_control(TFT_WIDTH - X_MARGIN - BTN_WIDTH, y, BACK, imgBack));
TERN_(TOUCH_SCREEN, add_control(TFT_WIDTH - X_MARGIN - BTN_WIDTH, y, TouchControlType::BACK, imgBack));
}

#endif // HAS_UI_480x320
Loading