Bläddra i källkod

MKS prelim. cleanup (2)

Scott Lahteine 3 år sedan
förälder
incheckning
12a39450b0

+ 3
- 7
Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp Visa fil

@@ -55,20 +55,16 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
55 55
   switch (obj->mks_obj_id) {
56 56
     case ID_E_ADD:
57 57
       if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) {
58
-        queue.enqueue_now_P(PSTR("G91"));
59
-        sprintf_P((char *)public_buf_l, PSTR("G1 E%d F%d"), uiCfg.extruStep, 60 * uiCfg.extruSpeed);
60
-        queue.enqueue_one_now(public_buf_l);
61
-        queue.enqueue_now_P(PSTR("G90"));
58
+        sprintf_P((char *)public_buf_l, PSTR("G91\nG1 E%d F%d\nG90"), uiCfg.extruStep, 60 * uiCfg.extruSpeed);
59
+        queue.inject(public_buf_l);
62 60
         extrudeAmount += uiCfg.extruStep;
63 61
         disp_extru_amount();
64 62
       }
65 63
       break;
66 64
     case ID_E_DEC:
67 65
       if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) {
68
-        queue.enqueue_now_P(PSTR("G91"));
69
-        sprintf_P((char *)public_buf_l, PSTR("G1 E%d F%d"), 0 - uiCfg.extruStep, 60 * uiCfg.extruSpeed);
66
+        sprintf_P((char *)public_buf_l, PSTR("G91\nG1 E%d F%d\nG90"), 0 - uiCfg.extruStep, 60 * uiCfg.extruSpeed);
70 67
         queue.enqueue_one_now(public_buf_l);
71
-        queue.enqueue_now_P(PSTR("G90"));
72 68
         extrudeAmount -= uiCfg.extruStep;
73 69
         disp_extru_amount();
74 70
       }

+ 2
- 6
Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp Visa fil

@@ -59,10 +59,8 @@ void printer_state_polling() {
59 59
         uiCfg.current_z_position_bak = current_position.z;
60 60
 
61 61
         if (gCfgItems.pausePosZ != (float)-1) {
62
-          gcode.process_subcommands_now_P(PSTR("G91"));
63
-          sprintf_P(public_buf_l, PSTR("G1 Z%.1f"), gCfgItems.pausePosZ);
62
+          sprintf_P(public_buf_l, PSTR("G91\nG1 Z%.1f\nG90"), gCfgItems.pausePosZ);
64 63
           gcode.process_subcommands_now(public_buf_l);
65
-          gcode.process_subcommands_now_P(PSTR("G90"));
66 64
         }
67 65
         if (gCfgItems.pausePosX != (float)-1 && gCfgItems.pausePosY != (float)-1) {
68 66
           sprintf_P(public_buf_l, PSTR("G1 X%.1f Y%.1f"), gCfgItems.pausePosX, gCfgItems.pausePosY);
@@ -128,10 +126,8 @@ void printer_state_polling() {
128 126
         gcode.process_subcommands_now(public_buf_m);
129 127
 
130 128
         if (gCfgItems.pause_reprint && gCfgItems.pausePosZ != -1.0f) {
131
-          gcode.process_subcommands_now_P(PSTR("G91"));
132
-          sprintf_P(public_buf_l, PSTR("G1 Z-%.1f"), gCfgItems.pausePosZ);
129
+          sprintf_P(public_buf_l, PSTR("G91\nG1 Z-%.1f\nG90"), gCfgItems.pausePosZ);
133 130
           gcode.process_subcommands_now(public_buf_l);
134
-          gcode.process_subcommands_now_P(PSTR("G90"));
135 131
         }
136 132
       #endif
137 133
       uiCfg.print_state = WORKING;

+ 14
- 42
Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp Visa fil

@@ -945,27 +945,13 @@ void disp_language_init() {
945 945
       filesys_menu.usb_sys = U_DISK_TEXT_CN;
946 946
       //
947 947
       more_menu.title       = TITLE_MORE_CN;
948
-      #if ENABLED(USER_CMD_1_ENABLE)
949
-        more_menu.custom1 = MORE_CUSTOM1_TEXT_CN;
950
-      #endif
951
-      #if ENABLED(USER_CMD_2_ENABLE)
952
-        more_menu.custom2 = MORE_CUSTOM2_TEXT_CN;
953
-      #endif
954
-      #if ENABLED(USER_CMD_3_ENABLE)
955
-        more_menu.custom3 = MORE_CUSTOM3_TEXT_CN;
956
-      #endif
957
-      #if ENABLED(USER_CMD_4_ENABLE)
958
-        more_menu.custom4 = MORE_CUSTOM4_TEXT_CN;
959
-      #endif
960
-      #if ENABLED(USER_CMD_5_ENABLE)
961
-        more_menu.custom5 = MORE_CUSTOM5_TEXT_CN;
962
-      #endif
963
-      #if ENABLED(USER_CMD_6_ENABLE)
964
-        more_menu.custom6 = MORE_CUSTOM6_TEXT_CN;
965
-      #endif
966
-      #if ENABLED(USER_CMD_7_ENABLE)
967
-        more_menu.custom7 = MORE_CUSTOM7_TEXT_CN;
968
-      #endif
948
+      TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_CN);
949
+      TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_CN);
950
+      TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_CN);
951
+      TERN_(USER_CMD_4_ENABLE, more_menu.custom4 = MORE_CUSTOM4_TEXT_CN);
952
+      TERN_(USER_CMD_5_ENABLE, more_menu.custom5 = MORE_CUSTOM5_TEXT_CN);
953
+      TERN_(USER_CMD_6_ENABLE, more_menu.custom6 = MORE_CUSTOM6_TEXT_CN);
954
+      TERN_(USER_CMD_7_ENABLE, more_menu.custom7 = MORE_CUSTOM7_TEXT_CN);
969 955
       // WIFI
970 956
       wifi_menu.title = WIFI_TEXT;
971 957
       wifi_menu.cloud     = CLOUD_TEXT_CN;
@@ -1191,27 +1177,13 @@ void disp_language_init() {
1191 1177
             filesys_menu.usb_sys  = U_DISK_TEXT_T_CN;
1192 1178
             //
1193 1179
             more_menu.title       = TITLE_MORE_T_CN;
1194
-            #if ENABLED(USER_CMD_1_ENABLE)
1195
-              more_menu.custom1 = MORE_CUSTOM1_TEXT_T_CN;
1196
-            #endif
1197
-            #if ENABLED(USER_CMD_2_ENABLE)
1198
-              more_menu.custom2 = MORE_CUSTOM2_TEXT_T_CN;
1199
-            #endif
1200
-            #if ENABLED(USER_CMD_3_ENABLE)
1201
-              more_menu.custom3 = MORE_CUSTOM3_TEXT_T_CN;
1202
-            #endif
1203
-            #if ENABLED(USER_CMD_4_ENABLE)
1204
-              more_menu.custom4 = MORE_CUSTOM4_TEXT_T_CN;
1205
-            #endif
1206
-            #if ENABLED(USER_CMD_5_ENABLE)
1207
-              more_menu.custom5 = MORE_CUSTOM5_TEXT_T_CN;
1208
-            #endif
1209
-            #if ENABLED(USER_CMD_6_ENABLE)
1210
-              more_menu.custom6 = MORE_CUSTOM6_TEXT_T_CN;
1211
-            #endif
1212
-            #if ENABLED(USER_CMD_7_ENABLE)
1213
-              more_menu.custom7 = MORE_CUSTOM7_TEXT_T_CN;
1214
-            #endif
1180
+            TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_T_CN);
1181
+            TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_T_CN);
1182
+            TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_T_CN);
1183
+            TERN_(USER_CMD_4_ENABLE, more_menu.custom4 = MORE_CUSTOM4_TEXT_T_CN);
1184
+            TERN_(USER_CMD_5_ENABLE, more_menu.custom5 = MORE_CUSTOM5_TEXT_T_CN);
1185
+            TERN_(USER_CMD_6_ENABLE, more_menu.custom6 = MORE_CUSTOM6_TEXT_T_CN);
1186
+            TERN_(USER_CMD_7_ENABLE, more_menu.custom7 = MORE_CUSTOM7_TEXT_T_CN);
1215 1187
             // WIFI
1216 1188
             wifi_menu.title     = WIFI_TEXT;
1217 1189
             wifi_menu.cloud     = CLOUD_TEXT_T_CN;

Laddar…
Avbryt
Spara