Browse Source

COLOR_UI without TOUCH_SCREEN 👍🏻 (#20178)

Victor Oliveira 3 years ago
parent
commit
75924edcf8
No account linked to committer's email address

+ 3
- 1
Marlin/src/lcd/menu/menu_bed_leveling.cpp View File

169
     if (ui.should_draw()) {
169
     if (ui.should_draw()) {
170
       MenuItem_static::draw(1, GET_TEXT(MSG_LEVEL_BED_WAITING));
170
       MenuItem_static::draw(1, GET_TEXT(MSG_LEVEL_BED_WAITING));
171
       // Color UI needs a control to detect a touch
171
       // Color UI needs a control to detect a touch
172
-      TERN_(HAS_GRAPHICAL_TFT, touch.add_control(CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT));
172
+      #if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT)
173
+        touch.add_control(CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT);
174
+      #endif
173
     }
175
     }
174
     if (ui.use_click()) {
176
     if (ui.use_click()) {
175
       manual_probe_index = 0;
177
       manual_probe_index = 0;

+ 32
- 28
Marlin/src/lcd/tft/ui_480x320.cpp View File

49
   #error "Seriously? High resolution TFT screen without menu?"
49
   #error "Seriously? High resolution TFT screen without menu?"
50
 #endif
50
 #endif
51
 
51
 
52
-static bool draw_menu_navigation = false;
52
+#if ENABLED(TOUCH_SCREEN)
53
+  static bool draw_menu_navigation = false;
54
+#endif
53
 
55
 
54
 void MarlinUI::tft_idle() {
56
 void MarlinUI::tft_idle() {
55
   #if ENABLED(TOUCH_SCREEN)
57
   #if ENABLED(TOUCH_SCREEN)
897
   moveAxis(Z_AXIS, -1);
899
   moveAxis(Z_AXIS, -1);
898
 }
900
 }
899
 
901
 
900
-static void e_select() {
901
-  motionAxisState.e_selection++;
902
-  if (motionAxisState.e_selection >= EXTRUDERS) {
903
-    motionAxisState.e_selection = 0;
904
-  }
902
+#if ENABLED(TOUCH_SCREEN)
903
+  static void e_select() {
904
+    motionAxisState.e_selection++;
905
+    if (motionAxisState.e_selection >= EXTRUDERS) {
906
+      motionAxisState.e_selection = 0;
907
+    }
905
 
908
 
906
-  quick_feedback();
907
-  drawCurESelection();
908
-  drawAxisValue(E_AXIS);
909
-}
909
+    quick_feedback();
910
+    drawCurESelection();
911
+    drawAxisValue(E_AXIS);
912
+  }
910
 
913
 
911
-static void do_home() {
912
-  quick_feedback();
913
-  drawMessage(GET_TEXT(MSG_LEVEL_BED_HOMING));
914
-  queue.inject_P(G28_STR);
915
-  // Disable touch until home is done
916
-  TERN_(HAS_TFT_XPT2046, touch.disable());
917
-  drawAxisValue(E_AXIS);
918
-  drawAxisValue(X_AXIS);
919
-  drawAxisValue(Y_AXIS);
920
-  drawAxisValue(Z_AXIS);
921
-}
914
+  static void do_home() {
915
+    quick_feedback();
916
+    drawMessage(GET_TEXT(MSG_LEVEL_BED_HOMING));
917
+    queue.inject_P(G28_STR);
918
+    // Disable touch until home is done
919
+    TERN_(HAS_TFT_XPT2046, touch.disable());
920
+    drawAxisValue(E_AXIS);
921
+    drawAxisValue(X_AXIS);
922
+    drawAxisValue(Y_AXIS);
923
+    drawAxisValue(Z_AXIS);
924
+  }
922
 
925
 
923
-static void step_size() {
924
-  motionAxisState.currentStepSize = motionAxisState.currentStepSize / 10.0;
925
-  if (motionAxisState.currentStepSize < 0.0015) motionAxisState.currentStepSize = 10.0;
926
-  quick_feedback();
927
-  drawCurStepValue();
928
-}
926
+  static void step_size() {
927
+    motionAxisState.currentStepSize = motionAxisState.currentStepSize / 10.0;
928
+    if (motionAxisState.currentStepSize < 0.0015) motionAxisState.currentStepSize = 10.0;
929
+    quick_feedback();
930
+    drawCurStepValue();
931
+  }
932
+#endif
929
 
933
 
930
 #if HAS_BED_PROBE
934
 #if HAS_BED_PROBE
931
   static void z_select() {
935
   static void z_select() {
1021
   motionAxisState.zTypePos.x = x;
1025
   motionAxisState.zTypePos.x = x;
1022
   motionAxisState.zTypePos.y = y;
1026
   motionAxisState.zTypePos.y = y;
1023
   drawCurZSelection();
1027
   drawCurZSelection();
1024
-  #if HAS_BED_PROBE
1028
+  #if BOTH(HAS_BED_PROBE, TOUCH_SCREEN)
1025
     if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, 34 * 2, (intptr_t)z_select);
1029
     if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, 34 * 2, (intptr_t)z_select);
1026
   #endif
1030
   #endif
1027
 
1031
 

+ 9
- 0
buildroot/tests/mks_robin_nano35-tests View File

65
 opt_set Y_DRIVER_TYPE TMC2209
65
 opt_set Y_DRIVER_TYPE TMC2209
66
 exec_test $1 $2 "MKS Robin v2 nano LVGL SPI + TMC" "$3"
66
 exec_test $1 $2 "MKS Robin v2 nano LVGL SPI + TMC" "$3"
67
 
67
 
68
+#
69
+# MKS Robin v2 nano New Color UI 480x320 SPI Without Touch Screen
70
+#
71
+use_example_configs Mks/Robin
72
+opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2
73
+opt_disable TFT_INTERFACE_FSMC TFT_RES_320x240 TOUCH_SCREEN
74
+opt_enable TFT_INTERFACE_SPI TFT_RES_480x320 TFT_COLOR_UI
75
+exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI without TOUCH_SCREEN"
76
+
68
 # cleanup
77
 # cleanup
69
 restore_configs
78
 restore_configs

Loading…
Cancel
Save