Przeglądaj źródła

Fix Move Screen with disabled Touch (#19558)

Victor Oliveira 3 lat temu
rodzic
commit
ca853fbe19
1 zmienionych plików z 7 dodań i 7 usunięć
  1. 7
    7
      Marlin/src/lcd/tft/ui_480x320.cpp

+ 7
- 7
Marlin/src/lcd/tft/ui_480x320.cpp Wyświetl plik

@@ -924,7 +924,7 @@ static void do_home() {
924 924
   drawMessage(GET_TEXT(MSG_LEVEL_BED_HOMING));
925 925
   queue.inject_P(G28_STR);
926 926
   // Disable touch until home is done
927
-  touch.disable();
927
+  TERN_(HAS_TFT_XPT2046, touch.disable());
928 928
   drawAxisValue(E_AXIS);
929 929
   drawAxisValue(X_AXIS);
930 930
   drawAxisValue(Y_AXIS);
@@ -972,14 +972,14 @@ static void drawBtn(int x, int y, const char* label, int32_t data, MarlinImage i
972 972
     tft.add_image(0, 0, img, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY);
973 973
   }
974 974
 
975
-  if (enabled) touch.add_control(BUTTON, x, y, width, height, data);
975
+  TERN_(HAS_TFT_XPT2046, if (enabled) touch.add_control(BUTTON, x, y, width, height, data));
976 976
 }
977 977
 
978 978
 void MarlinUI::move_axis_screen() {
979 979
   // Reset
980 980
   defer_status_screen(true);
981 981
   motionAxisState.blocked = false;
982
-  touch.enable();
982
+  TERN_(HAS_TFT_XPT2046, touch.enable());
983 983
 
984 984
   ui.clear_lcd();
985 985
 
@@ -1016,13 +1016,13 @@ void MarlinUI::move_axis_screen() {
1016 1016
   motionAxisState.eNamePos.x = x;
1017 1017
   motionAxisState.eNamePos.y = y;
1018 1018
   drawCurESelection();
1019
-  if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, BTN_HEIGHT, (int32_t)e_select);
1019
+  TERN_(HAS_TFT_XPT2046, if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, BTN_HEIGHT, (int32_t)e_select));
1020 1020
 
1021 1021
   x += BTN_WIDTH + spacing;
1022 1022
   drawBtn(x, y, "X-", (int32_t)x_minus, imgLeft, X_BTN_COLOR, !busy);
1023 1023
 
1024 1024
   x += BTN_WIDTH + spacing; //imgHome is 64x64
1025
-  add_control(TFT_WIDTH / 2 - Images[imgHome].width / 2, y - (Images[imgHome].width - BTN_HEIGHT) / 2, BUTTON, (int32_t)do_home, imgHome, !busy);
1025
+  TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH / 2 - Images[imgHome].width / 2, y - (Images[imgHome].width - BTN_HEIGHT) / 2, BUTTON, (int32_t)do_home, imgHome, !busy));
1026 1026
 
1027 1027
   x += BTN_WIDTH + spacing;
1028 1028
   uint16_t xplus_x = x;
@@ -1071,13 +1071,13 @@ void MarlinUI::move_axis_screen() {
1071 1071
   motionAxisState.stepValuePos.y = y;
1072 1072
   if (!busy) {
1073 1073
     drawCurStepValue();
1074
-    touch.add_control(BUTTON, motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT, (int32_t)step_size);
1074
+    TERN_(HAS_TFT_XPT2046, touch.add_control(BUTTON, motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT, (int32_t)step_size));
1075 1075
   }
1076 1076
 
1077 1077
   // alinged with x+
1078 1078
   drawBtn(xplus_x, TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT, "off", (int32_t)disable_steppers, imgCancel, COLOR_WHITE, !busy);
1079 1079
 
1080
-  add_control(TFT_WIDTH - X_MARGIN - BTN_WIDTH, y, BACK, imgBack);
1080
+  TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH - X_MARGIN - BTN_WIDTH, y, BACK, imgBack));
1081 1081
 }
1082 1082
 
1083 1083
 #undef BTN_WIDTH

Ładowanie…
Anuluj
Zapisz