Переглянути джерело

MKS H43 fixup (#21267)

Co-authored-by: makerbase <4164049@qq.com>
Co-authored-by: MKS-Sean <56996910+MKS-Sean@users.noreply.github.com>
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
Sola 3 роки тому
джерело
коміт
72cc5a49e6
Аккаунт користувача з таким Email не знайдено

+ 8
- 0
Marlin/src/gcode/queue.cpp Переглянути файл

@@ -611,6 +611,14 @@ void GCodeQueue::get_available_commands() {
611 611
 }
612 612
 
613 613
 /**
614
+ * Run the entire queue in-place. Blocks SD completion/abort until complete.
615
+ */
616
+void GCodeQueue::exhaust() {
617
+  while (ring_buffer.occupied()) advance();
618
+  planner.synchronize();
619
+}
620
+
621
+/**
614 622
  * Get the next command in the queue, optionally log it to SD, then dispatch it
615 623
  */
616 624
 void GCodeQueue::advance() {

+ 8
- 1
Marlin/src/gcode/queue.h Переглянути файл

@@ -93,7 +93,9 @@ public:
93 93
 
94 94
     inline bool full(uint8_t cmdCount=1) const { return length > (BUFSIZE - cmdCount); }
95 95
 
96
-    inline bool empty() const { return length == 0; }
96
+    inline bool occupied() const { return length != 0; }
97
+
98
+    inline bool empty() const { return !occupied(); }
97 99
 
98 100
     inline CommandLine& peek_next_command() { return commands[index_r]; }
99 101
 
@@ -163,6 +165,11 @@ public:
163 165
   static void advance();
164 166
 
165 167
   /**
168
+   * Run the entire queue in-place
169
+   */
170
+  static void exhaust();
171
+
172
+  /**
166 173
    * Add to the circular command queue the next command from:
167 174
    *  - The command-injection queue (injected_commands_P)
168 175
    *  - The active serial input (usually USB)

+ 6
- 3
Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp Переглянути файл

@@ -395,20 +395,23 @@ void DGUSScreenHandler::HandleTemperatureChanged(DGUS_VP_Variable &var, void *va
395 395
     default: return;
396 396
     #if HOTENDS >= 1
397 397
       case VP_T_E0_Set:
398
+        NOMORE(newvalue, HEATER_0_MAXTEMP);
398 399
         thermalManager.setTargetHotend(newvalue, 0);
399
-        acceptedvalue = thermalManager.temp_hotend[0].target;
400
+        acceptedvalue = thermalManager.degTargetHotend(0);
400 401
         break;
401 402
     #endif
402 403
     #if HOTENDS >= 2
403 404
       case VP_T_E1_Set:
405
+        NOMORE(newvalue, HEATER_1_MAXTEMP);
404 406
         thermalManager.setTargetHotend(newvalue, 1);
405
-        acceptedvalue = thermalManager.temp_hotend[1].target;
407
+        acceptedvalue = thermalManager.degTargetHotend(1);
406 408
         break;
407 409
     #endif
408 410
     #if HAS_HEATED_BED
409 411
       case VP_T_Bed_Set:
412
+        NOMORE(newvalue, BED_MAXTEMP);
410 413
         thermalManager.setTargetBed(newvalue);
411
-        acceptedvalue = thermalManager.temp_bed.target;
414
+        acceptedvalue = thermalManager.degTargetBed();
412 415
         break;
413 416
     #endif
414 417
   }

+ 1
- 1
Marlin/src/lcd/extui/lib/dgus/mks/DGUSDisplayDef.cpp Переглянути файл

@@ -75,7 +75,7 @@ uint16_t z_park_pos = 10;
75 75
 xyz_pos_t position_before_pause;
76 76
 
77 77
 void MKS_pause_print_move() {
78
-  planner.synchronize();
78
+  queue.exhaust();
79 79
   position_before_pause = current_position;
80 80
   do_blocking_move_to(X_MIN_POS + x_park_pos, Y_MIN_POS + y_park_pos, current_position.z + z_park_pos);
81 81
 }

+ 3
- 3
Marlin/src/lcd/extui/lib/dgus/mks/DGUSDisplayDef.h Переглянути файл

@@ -23,10 +23,10 @@
23 23
 
24 24
 #include "../DGUSDisplayDef.h"
25 25
 
26
-//#define USE_MKS_GREEN_UI
26
+#define USE_MKS_GREEN_UI
27 27
 //#define DGUS_MKS_RUNOUT_SENSOR
28 28
 
29
-#define LOGO_TIME_DELAY TERN(USE_MKS_GREEN_UI, 5000, 1500)
29
+#define LOGO_TIME_DELAY TERN(USE_MKS_GREEN_UI, 8000, 1500)
30 30
 
31 31
 #if ENABLED(DGUS_MKS_RUNOUT_SENSOR)
32 32
   #define MT_DET_1_PIN         1
@@ -178,7 +178,7 @@ enum DGUSLCD_Screens : uint8_t {
178 178
     MKSLCD_SCREEN_PRINT_CONFIG          =  72,
179 179
     MKSLCD_SCREEN_LEVEL_DATA            = 106,
180 180
     MKSLCD_PrintPause_SET               = 107,
181
-    //MKSLCD_FILAMENT_DATA                =  50,
181
+    MKSLCD_FILAMENT_DATA                =  50,
182 182
     MKSLCD_ABOUT                        =  83,
183 183
     MKSLCD_PID                          = 108,
184 184
     MKSLCD_PAUSE_SETTING_MOVE           =  98,

+ 24
- 24
Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp Переглянути файл

@@ -39,6 +39,7 @@
39 39
 #include "../../../../../gcode/gcode.h"
40 40
 #include "../../../../../pins/pins.h"
41 41
 #include "../../../../../libs/nozzle.h"
42
+
42 43
 #if ENABLED(HAS_STEALTHCHOP)
43 44
   #include "../../../../../module/stepper/trinamic.h"
44 45
   #include "../../../../../module/stepper/indirection.h"
@@ -60,7 +61,6 @@ uint8_t DGUSLanguageSwitch = 0; // Switch language for MKS DGUS
60 61
 uint32_t swap32(const uint32_t value) { return (value & 0x000000FFU) << 24U | (value & 0x0000FF00U) << 8U | (value & 0x00FF0000U) >> 8U | (value & 0xFF000000U) >> 24U; }
61 62
 
62 63
 #if 0
63
-
64 64
 void DGUSScreenHandler::sendinfoscreen_ch_mks(const uint16_t* line1, const uint16_t* line2, const uint16_t* line3, const uint16_t* line4) {
65 65
   dgusdisplay.WriteVariable(VP_MSGSTR1, line1, 32, true);
66 66
   dgusdisplay.WriteVariable(VP_MSGSTR2, line2, 32, true);
@@ -264,7 +264,7 @@ void DGUSScreenHandler::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) {
264 264
 
265 265
   void DGUSScreenHandler::SDPrintingFinished() {
266 266
     if (DGUSAutoTurnOff) {
267
-      while (!queue.ring_buffer.empty()) queue.advance();
267
+      queue.exhaust();
268 268
       gcode.process_subcommands_now_P(PSTR("M81"));
269 269
     }
270 270
     GotoScreen(MKSLCD_SCREEN_PrintDone);
@@ -465,7 +465,6 @@ void DGUSScreenHandler::Level_Ctrl_MKS(DGUS_VP_Variable &var, void *val_ptr) {
465 465
 
466 466
         cs = getCurrentScreen();
467 467
         if (cs != MKSLCD_AUTO_LEVEL) GotoScreen(MKSLCD_AUTO_LEVEL);
468
-
469 468
       #else
470 469
 
471 470
         GotoScreen(MKSLCD_SCREEN_LEVEL);
@@ -499,14 +498,15 @@ void DGUSScreenHandler::MeshLevel(DGUS_VP_Variable &var, void *val_ptr) {
499 498
     char cmd_buf[30];
500 499
     float offset = mesh_adj_distance;
501 500
     int16_t integer, Deci, Deci2;
502
-    // float f3 = current_position.z;
503
-    // float f4 = current_position.z;
501
+
502
+    if (!queue.ring_buffer.empty()) return;
503
+
504 504
     switch (mesh_value) {
505 505
       case 0:
506 506
         offset = mesh_adj_distance;
507 507
         integer = offset; // get int
508
-        Deci = (offset * 100);
509
-        Deci = Deci % 100;
508
+        Deci = (offset * 10);
509
+        Deci = Deci % 10;
510 510
         Deci2 = offset * 100;
511 511
         Deci2 = Deci2 % 10;
512 512
         soft_endstop._enabled = false;
@@ -520,8 +520,8 @@ void DGUSScreenHandler::MeshLevel(DGUS_VP_Variable &var, void *val_ptr) {
520 520
       case 1:
521 521
         offset = mesh_adj_distance;
522 522
         integer = offset;       // get int
523
-        Deci = (offset * 100);
524
-        Deci = Deci % 100;
523
+        Deci = (offset * 10);
524
+        Deci = Deci % 10;
525 525
         Deci2 = offset * 100;
526 526
         Deci2 = Deci2 % 10;
527 527
         soft_endstop._enabled = false;
@@ -589,8 +589,8 @@ void DGUSScreenHandler::LCD_BLK_Adjust(DGUS_VP_Variable &var, void *val_ptr) {
589 589
 
590 590
   uint16_t lcd_value = swap16(*(uint16_t *)val_ptr);
591 591
 
592
-  if(lcd_value > 100) lcd_value = 100;
593
-  else if(lcd_value < 10) lcd_value = 10;
592
+  if (lcd_value > 100) lcd_value = 100;
593
+  else if (lcd_value < 10) lcd_value = 10;
594 594
 
595 595
   lcd_default_light = lcd_value;
596 596
 
@@ -794,7 +794,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
794 794
 
795 795
   DEBUG_ECHOLNPAIR("QUEUE LEN:", queue.length);
796 796
 
797
-  if (!print_job_timer.isPaused() && queue.ring_buffer.full(1))
797
+  if (!print_job_timer.isPaused() && !queue.ring_buffer.empty())
798 798
     return;
799 799
 
800 800
   char axiscode;
@@ -1249,8 +1249,8 @@ void DGUSScreenHandler::MKS_FilamentLoad(DGUS_VP_Variable &var, void *val_ptr) {
1249 1249
   switch (val_t) {
1250 1250
     case 0:
1251 1251
       #if HOTENDS >= 1
1252
-        if (thermalManager.temp_hotend[0].celsius < thermalManager.extrude_min_temp) {
1253
-          if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp)
1252
+        if (thermalManager.degHotend(0) < thermalManager.extrude_min_temp) {
1253
+          if (thermalManager.degTargetHotend(0) < thermalManager.extrude_min_temp)
1254 1254
             thermalManager.setTargetHotend(thermalManager.extrude_min_temp, 0);
1255 1255
           sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("Please wait."), PSTR("Nozzle heating!"), true, true, true, true);
1256 1256
           SetupConfirmAction(nullptr);
@@ -1268,8 +1268,8 @@ void DGUSScreenHandler::MKS_FilamentLoad(DGUS_VP_Variable &var, void *val_ptr) {
1268 1268
 
1269 1269
     case 1:
1270 1270
       #if HOTENDS >= 2
1271
-        if (thermalManager.temp_hotend[1].celsius < thermalManager.extrude_min_temp) {
1272
-          if (thermalManager.temp_hotend[1].target < thermalManager.extrude_min_temp)
1271
+        if (thermalManager.degHotend(1) < thermalManager.extrude_min_temp) {
1272
+          if (thermalManager.degTargetHotend(1) < thermalManager.extrude_min_temp)
1273 1273
             thermalManager.setTargetHotend(thermalManager.extrude_min_temp, 1);
1274 1274
           sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("Please wait."), PSTR("Nozzle heating!"), true, true, true, true);
1275 1275
           SetupConfirmAction(nullptr);
@@ -1284,8 +1284,8 @@ void DGUSScreenHandler::MKS_FilamentLoad(DGUS_VP_Variable &var, void *val_ptr) {
1284 1284
         }
1285 1285
       #endif
1286 1286
       #if ENABLED(SINGLENOZZLE)
1287
-        if (thermalManager.temp_hotend[0].celsius < thermalManager.extrude_min_temp) {
1288
-          if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp)
1287
+        if (thermalManager.degHotend(0) < thermalManager.extrude_min_temp) {
1288
+          if (thermalManager.degTargetHotend(0) < thermalManager.extrude_min_temp)
1289 1289
             thermalManager.setTargetHotend(thermalManager.extrude_min_temp, 0);
1290 1290
           sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("Please wait."), PSTR("Nozzle heating!"), true, true, true, true);
1291 1291
           SetupConfirmAction(nullptr);
@@ -1313,8 +1313,8 @@ void DGUSScreenHandler::MKS_FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr)
1313 1313
   switch (val_t) {
1314 1314
     case 0:
1315 1315
       #if HOTENDS >= 1
1316
-        if (thermalManager.temp_hotend[0].celsius < thermalManager.extrude_min_temp) {
1317
-          if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp)
1316
+        if (thermalManager.degHotend(0) < thermalManager.extrude_min_temp) {
1317
+          if (thermalManager.degTargetHotend(0) < thermalManager.extrude_min_temp)
1318 1318
             thermalManager.setTargetHotend(thermalManager.extrude_min_temp, 0);
1319 1319
           sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("Please wait."), PSTR("Nozzle heating!"), true, true, true, true);
1320 1320
           SetupConfirmAction(nullptr);
@@ -1331,8 +1331,8 @@ void DGUSScreenHandler::MKS_FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr)
1331 1331
       break;
1332 1332
     case 1:
1333 1333
       #if HOTENDS >= 2
1334
-        if (thermalManager.temp_hotend[1].celsius < thermalManager.extrude_min_temp) {
1335
-          if (thermalManager.temp_hotend[1].target < thermalManager.extrude_min_temp)
1334
+        if (thermalManager.degHotend(1) < thermalManager.extrude_min_temp) {
1335
+          if (thermalManager.degTargetHotend(1) < thermalManager.extrude_min_temp)
1336 1336
             thermalManager.setTargetHotend(thermalManager.extrude_min_temp, 1);
1337 1337
           sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("Please wait."), PSTR("Nozzle heating!"), true, true, true, true);
1338 1338
           SetupConfirmAction(nullptr);
@@ -1348,8 +1348,8 @@ void DGUSScreenHandler::MKS_FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr)
1348 1348
       #endif
1349 1349
 
1350 1350
       #if ENABLED(SINGLENOZZLE)
1351
-        if (thermalManager.temp_hotend[0].celsius < thermalManager.extrude_min_temp) {
1352
-          if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp)
1351
+        if (thermalManager.degHotend(0) < thermalManager.extrude_min_temp) {
1352
+          if (thermalManager.degTargetHotend(0) < thermalManager.extrude_min_temp)
1353 1353
             thermalManager.setTargetHotend(thermalManager.extrude_min_temp, 0);
1354 1354
           sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("Please wait."), PSTR("Nozzle heating!"), true, true, true, true);
1355 1355
           SetupConfirmAction(nullptr);

+ 11
- 11
Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp Переглянути файл

@@ -191,7 +191,7 @@ static void btn_cancel_event_cb(lv_obj_t *btn, lv_event_t event) {
191 191
     TERN_(ADVANCED_PAUSE_FEATURE, pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT);
192 192
   }
193 193
   else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT, TYPE_FILAMENT_UNLOAD_HEAT, TYPE_FILAMENT_HEAT_LOAD_COMPLETED, TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED)) {
194
-    thermalManager.temp_hotend[uiCfg.curSprayerChoose].target= uiCfg.desireSprayerTempBak;
194
+    thermalManager.setTargetHotend(uiCfg.hotendTargetTempBak, uiCfg.extruderIndex);
195 195
     clear_cur_ui();
196 196
     draw_return_ui();
197 197
   }
@@ -204,7 +204,7 @@ static void btn_cancel_event_cb(lv_obj_t *btn, lv_event_t event) {
204 204
     uiCfg.filament_loading_time_cnt    = 0;
205 205
     uiCfg.filament_unloading_time_flg  = false;
206 206
     uiCfg.filament_unloading_time_cnt  = 0;
207
-    thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = uiCfg.desireSprayerTempBak;
207
+    thermalManager.setTargetHotend(uiCfg.hotendTargetTempBak, uiCfg.extruderIndex);
208 208
     clear_cur_ui();
209 209
     draw_return_ui();
210 210
   }
@@ -479,9 +479,9 @@ void lv_draw_dialog(uint8_t type) {
479 479
 
480 480
 void filament_sprayer_temp() {
481 481
   char buf[20] = {0};
482
-  sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target);
482
+  sprintf(buf, preheat_menu.value_state, (int)thermalManager.degHotend(uiCfg.extruderIndex), (int)thermalManager.degTargetHotend(uiCfg.extruderIndex));
483 483
 
484
-  strcpy(public_buf_l, uiCfg.curSprayerChoose < 1 ? extrude_menu.ext1 : extrude_menu.ext2);
484
+  strcpy(public_buf_l, uiCfg.extruderIndex < 1 ? extrude_menu.ext1 : extrude_menu.ext2);
485 485
   strcat_P(public_buf_l, PSTR(": "));
486 486
   strcat(public_buf_l, buf);
487 487
   lv_label_set_text(tempText1, public_buf_l);
@@ -500,7 +500,7 @@ void filament_dialog_handle() {
500 500
     planner.synchronize();
501 501
     uiCfg.filament_loading_time_flg = true;
502 502
     uiCfg.filament_loading_time_cnt = 0;
503
-    sprintf_P(public_buf_m, PSTR("T%d\nG91\nG1 E%d F%d\nG90"), uiCfg.curSprayerChoose, gCfgItems.filamentchange_load_length, gCfgItems.filamentchange_load_speed);
503
+    sprintf_P(public_buf_m, PSTR("T%d\nG91\nG1 E%d F%d\nG90"), uiCfg.extruderIndex, gCfgItems.filamentchange_load_length, gCfgItems.filamentchange_load_speed);
504 504
     queue.inject(public_buf_m);
505 505
   }
506 506
   if (uiCfg.filament_heat_completed_unload) {
@@ -510,13 +510,13 @@ void filament_dialog_handle() {
510 510
     planner.synchronize();
511 511
     uiCfg.filament_unloading_time_flg = true;
512 512
     uiCfg.filament_unloading_time_cnt = 0;
513
-    sprintf_P(public_buf_m, PSTR("T%d\nG91\nG1 E-%d F%d\nG90"), uiCfg.curSprayerChoose, gCfgItems.filamentchange_unload_length, gCfgItems.filamentchange_unload_speed);
513
+    sprintf_P(public_buf_m, PSTR("T%d\nG91\nG1 E-%d F%d\nG90"), uiCfg.extruderIndex, gCfgItems.filamentchange_unload_length, gCfgItems.filamentchange_unload_speed);
514 514
     queue.inject(public_buf_m);
515 515
   }
516 516
 
517
-  if (((abs((int)((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius - gCfgItems.filament_limit_temper)) <= 1)
518
-    || ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius > gCfgItems.filament_limit_temper))
519
-    && (uiCfg.filament_load_heat_flg)
517
+  if ( ((abs((int)((int)thermalManager.degHotend(uiCfg.extruderIndex) - gCfgItems.filament_limit_temper)) <= 1)
518
+        || ((int)thermalManager.degHotend(uiCfg.extruderIndex) > gCfgItems.filament_limit_temper))
519
+    && uiCfg.filament_load_heat_flg
520 520
   ) {
521 521
     uiCfg.filament_load_heat_flg = false;
522 522
     lv_clear_dialog();
@@ -529,8 +529,8 @@ void filament_dialog_handle() {
529 529
     lv_clear_dialog();
530 530
     lv_draw_dialog(DIALOG_TYPE_FILAMENT_LOAD_COMPLETED);
531 531
   }
532
-  if (((abs((int)((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius - gCfgItems.filament_limit_temper)) <= 1)
533
-     || ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius > gCfgItems.filament_limit_temper))
532
+  if (((abs((int)((int)thermalManager.degHotend(uiCfg.extruderIndex) - gCfgItems.filament_limit_temper)) <= 1)
533
+     || ((int)thermalManager.degHotend(uiCfg.extruderIndex) > gCfgItems.filament_limit_temper))
534 534
      && uiCfg.filament_unload_heat_flg
535 535
   ) {
536 536
     uiCfg.filament_unload_heat_flg = false;

+ 9
- 9
Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp Переглянути файл

@@ -54,7 +54,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
54 54
   if (event != LV_EVENT_RELEASED) return;
55 55
   switch (obj->mks_obj_id) {
56 56
     case ID_E_ADD:
57
-      if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) {
57
+      if (thermalManager.degHotend(uiCfg.extruderIndex) >= EXTRUDE_MINTEMP) {
58 58
         sprintf_P((char *)public_buf_l, PSTR("G91\nG1 E%d F%d\nG90"), uiCfg.extruStep, 60 * uiCfg.extruSpeed);
59 59
         queue.inject(public_buf_l);
60 60
         extrudeAmount += uiCfg.extruStep;
@@ -62,7 +62,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
62 62
       }
63 63
       break;
64 64
     case ID_E_DEC:
65
-      if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) {
65
+      if (thermalManager.degHotend(uiCfg.extruderIndex) >= EXTRUDE_MINTEMP) {
66 66
         sprintf_P((char *)public_buf_l, PSTR("G91\nG1 E%d F%d\nG90"), 0 - uiCfg.extruStep, 60 * uiCfg.extruSpeed);
67 67
         queue.enqueue_one_now(public_buf_l);
68 68
         extrudeAmount -= uiCfg.extruStep;
@@ -71,17 +71,17 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
71 71
       break;
72 72
     case ID_E_TYPE:
73 73
       if (ENABLED(HAS_MULTI_EXTRUDER)) {
74
-        if (uiCfg.curSprayerChoose == 0) {
75
-          uiCfg.curSprayerChoose = 1;
74
+        if (uiCfg.extruderIndex == 0) {
75
+          uiCfg.extruderIndex = 1;
76 76
           queue.inject_P(PSTR("T1"));
77 77
         }
78 78
         else {
79
-          uiCfg.curSprayerChoose = 0;
79
+          uiCfg.extruderIndex = 0;
80 80
           queue.inject_P(PSTR("T0"));
81 81
         }
82 82
       }
83 83
       else
84
-        uiCfg.curSprayerChoose = 0;
84
+        uiCfg.extruderIndex = 0;
85 85
 
86 86
       extrudeAmount = 0;
87 87
       disp_hotend_temp();
@@ -153,7 +153,7 @@ void lv_draw_extrusion() {
153 153
 }
154 154
 
155 155
 void disp_ext_type() {
156
-  if (uiCfg.curSprayerChoose == 1) {
156
+  if (uiCfg.extruderIndex == 1) {
157 157
     lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru2.bin");
158 158
     if (gCfgItems.multiple_language) {
159 159
       lv_label_set_text(labelType, extrude_menu.ext2);
@@ -195,7 +195,7 @@ void disp_ext_speed() {
195 195
 
196 196
 void disp_hotend_temp() {
197 197
   char buf[20] = {0};
198
-  sprintf(buf, extrude_menu.temp_value, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target);
198
+  sprintf(buf, extrude_menu.temp_value, (int)thermalManager.degHotend(uiCfg.extruderIndex), (int)thermalManager.degTargetHotend(uiCfg.extruderIndex));
199 199
   strcpy(public_buf_l, extrude_menu.temper_text);
200 200
   strcat(public_buf_l, buf);
201 201
   lv_label_set_text(tempText, public_buf_l);
@@ -213,7 +213,7 @@ void disp_extru_amount() {
213 213
     sprintf(buf1, extrude_menu.count_value_cm, extrudeAmount / 10);
214 214
   else
215 215
     sprintf(buf1, extrude_menu.count_value_m, extrudeAmount / 1000);
216
-  strcat(public_buf_l, uiCfg.curSprayerChoose < 1 ? extrude_menu.ext1 : extrude_menu.ext2);
216
+  strcat(public_buf_l, uiCfg.extruderIndex == 0 ? extrude_menu.ext1 : extrude_menu.ext2);
217 217
   strcat(public_buf_l, buf1);
218 218
 
219 219
   lv_label_set_text(ExtruText, public_buf_l);

+ 17
- 17
Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp Переглянути файл

@@ -50,25 +50,25 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
50 50
   switch (obj->mks_obj_id) {
51 51
     case ID_FILAMNT_IN:
52 52
       uiCfg.filament_load_heat_flg = true;
53
-      if ((abs(thermalManager.temp_hotend[uiCfg.curSprayerChoose].target - thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius) <= 1)
54
-          || (gCfgItems.filament_limit_temper <= thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius)) {
53
+      if ((abs(thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.degHotend(uiCfg.extruderIndex)) <= 1)
54
+          || (gCfgItems.filament_limit_temper <= thermalManager.degHotend(uiCfg.extruderIndex))) {
55 55
         lv_clear_filament_change();
56 56
         lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED);
57 57
       }
58 58
       else {
59 59
         lv_clear_filament_change();
60 60
         lv_draw_dialog(DIALOG_TYPE_FILAMENT_LOAD_HEAT);
61
-        if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].target < gCfgItems.filament_limit_temper) {
62
-          thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = gCfgItems.filament_limit_temper;
63
-          thermalManager.start_watching_hotend(uiCfg.curSprayerChoose);
61
+        if (thermalManager.degTargetHotend(uiCfg.extruderIndex) < gCfgItems.filament_limit_temper) {
62
+          thermalManager.setTargetHotend(gCfgItems.filament_limit_temper, uiCfg.extruderIndex);
63
+          thermalManager.start_watching_hotend(uiCfg.extruderIndex);
64 64
         }
65 65
       }
66 66
       break;
67 67
     case ID_FILAMNT_OUT:
68 68
       uiCfg.filament_unload_heat_flg = true;
69
-      if ((thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > 0)
70
-        && ((abs((int)((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target - thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius)) <= 1)
71
-        || ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= gCfgItems.filament_limit_temper))
69
+      if (thermalManager.degTargetHotend(uiCfg.extruderIndex)
70
+          && ((abs((int)((int)thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.degHotend(uiCfg.extruderIndex))) <= 1)
71
+              || ((int)thermalManager.degHotend(uiCfg.extruderIndex) >= gCfgItems.filament_limit_temper))
72 72
       ) {
73 73
         lv_clear_filament_change();
74 74
         lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED);
@@ -76,28 +76,28 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
76 76
       else {
77 77
         lv_clear_filament_change();
78 78
         lv_draw_dialog(DIALOG_TYPE_FILAMENT_UNLOAD_HEAT);
79
-        if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].target < gCfgItems.filament_limit_temper) {
80
-          thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = gCfgItems.filament_limit_temper;
81
-          thermalManager.start_watching_hotend(uiCfg.curSprayerChoose);
79
+        if (thermalManager.degTargetHotend(uiCfg.extruderIndex) < gCfgItems.filament_limit_temper) {
80
+          thermalManager.setTargetHotend(gCfgItems.filament_limit_temper, uiCfg.extruderIndex);
81
+          thermalManager.start_watching_hotend(uiCfg.extruderIndex);
82 82
         }
83 83
         filament_sprayer_temp();
84 84
       }
85 85
       break;
86 86
     case ID_FILAMNT_TYPE:
87 87
       #if HAS_MULTI_EXTRUDER
88
-        uiCfg.curSprayerChoose = !uiCfg.curSprayerChoose;
88
+        uiCfg.extruderIndex = !uiCfg.extruderIndex;
89 89
       #endif
90 90
       disp_filament_type();
91 91
       break;
92 92
     case ID_FILAMNT_RETURN:
93 93
       #if HAS_MULTI_EXTRUDER
94 94
         if (uiCfg.print_state != IDLE && uiCfg.print_state != REPRINTED)
95
-          gcode.process_subcommands_now_P(uiCfg.curSprayerChoose_bak == 1 ? PSTR("T1") : PSTR("T0"));
95
+          gcode.process_subcommands_now_P(uiCfg.extruderIndexBak == 1 ? PSTR("T1") : PSTR("T0"));
96 96
       #endif
97 97
       feedrate_mm_s = (float)uiCfg.moveSpeed_bak;
98 98
       if (uiCfg.print_state == PAUSED)
99 99
         planner.set_e_position_mm((destination.e = current_position.e = uiCfg.current_e_position_bak));
100
-      thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = uiCfg.desireSprayerTempBak;
100
+      thermalManager.setTargetHotend(uiCfg.hotendTargetTempBak, uiCfg.extruderIndex);
101 101
 
102 102
       clear_cur_ui();
103 103
       draw_return_ui();
@@ -132,7 +132,7 @@ void lv_draw_filament_change() {
132 132
 }
133 133
 
134 134
 void disp_filament_type() {
135
-  if (uiCfg.curSprayerChoose == 1) {
135
+  if (uiCfg.extruderIndex == 1) {
136 136
     lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru2.bin");
137 137
     if (gCfgItems.multiple_language) {
138 138
       lv_label_set_text(labelType, preheat_menu.ext2);
@@ -153,8 +153,8 @@ void disp_filament_temp() {
153 153
 
154 154
   public_buf_l[0] = '\0';
155 155
 
156
-  strcat(public_buf_l, uiCfg.curSprayerChoose < 1 ? preheat_menu.ext1 : preheat_menu.ext2);
157
-  sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius,  (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target);
156
+  strcat(public_buf_l, uiCfg.extruderIndex < 1 ? preheat_menu.ext1 : preheat_menu.ext2);
157
+  sprintf(buf, preheat_menu.value_state, (int)thermalManager.degHotend(uiCfg.extruderIndex), (int)thermalManager.degTargetHotend(uiCfg.extruderIndex));
158 158
 
159 159
   strcat_P(public_buf_l, PSTR(": "));
160 160
   strcat(public_buf_l, buf);

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp Переглянути файл

@@ -66,7 +66,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
66 66
       break;
67 67
     case ID_O_FILAMENT:
68 68
       #if HAS_MULTI_EXTRUDER
69
-        uiCfg.curSprayerChoose_bak = active_extruder;
69
+        uiCfg.extruderIndexBak = active_extruder;
70 70
       #endif
71 71
       if (uiCfg.print_state == WORKING) {
72 72
         #if ENABLED(SDSUPPORT)
@@ -76,7 +76,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
76 76
         #endif
77 77
       }
78 78
       uiCfg.moveSpeed_bak = (uint16_t)feedrate_mm_s;
79
-      uiCfg.desireSprayerTempBak = thermalManager.temp_hotend[active_extruder].target;
79
+      uiCfg.hotendTargetTempBak = thermalManager.degTargetHotend(active_extruder);
80 80
       lv_clear_operation();
81 81
       lv_draw_filament_change();
82 82
       break;

+ 32
- 33
Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp Переглянути файл

@@ -48,47 +48,46 @@ enum {
48 48
 static void event_handler(lv_obj_t *obj, lv_event_t event) {
49 49
   if (event != LV_EVENT_RELEASED) return;
50 50
   switch (obj->mks_obj_id) {
51
-    case ID_P_ADD:
51
+    case ID_P_ADD: {
52 52
       if (uiCfg.curTempType == 0) {
53
-        thermalManager.temp_hotend[uiCfg.curSprayerChoose].target += uiCfg.stepHeat;
54
-        if (uiCfg.curSprayerChoose == 0) {
55
-          if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) {
56
-            thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1);
57
-          }
58
-        }
53
+        int16_t max_target;
54
+        thermalManager.temp_hotend[uiCfg.extruderIndex].target += uiCfg.stepHeat;
55
+        if (uiCfg.extruderIndex == 0)
56
+          max_target = HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1);
59 57
         #if HAS_MULTI_HOTEND
60
-          else if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) {
61
-            thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1);
62
-          }
58
+          else
59
+            max_target = HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1);
63 60
         #endif
64
-        thermalManager.start_watching_hotend(uiCfg.curSprayerChoose);
61
+        if (thermalManager.degTargetHotend(uiCfg.extruderIndex) > max_target)
62
+          thermalManager.setTargetHotend(max_target, uiCfg.extruderIndex);
63
+        thermalManager.start_watching_hotend(uiCfg.extruderIndex);
65 64
       }
66 65
       #if HAS_HEATED_BED
67 66
         else {
67
+          constexpr int16_t max_target = BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1);
68 68
           thermalManager.temp_bed.target += uiCfg.stepHeat;
69
-          if ((int)thermalManager.temp_bed.target > BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) {
70
-            thermalManager.temp_bed.target = (float)BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1);
71
-          }
69
+          if (thermalManager.degTargetBed() > max_target)
70
+            thermalManager.setTargetBed(max_target);
72 71
           thermalManager.start_watching_bed();
73 72
         }
74 73
       #endif
75 74
       disp_desire_temp();
76
-      break;
75
+    } break;
76
+
77 77
     case ID_P_DEC:
78 78
       if (uiCfg.curTempType == 0) {
79
-        if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > uiCfg.stepHeat)
80
-          thermalManager.temp_hotend[uiCfg.curSprayerChoose].target -= uiCfg.stepHeat;
79
+        if ((int)thermalManager.degTargetHotend(uiCfg.extruderIndex) > uiCfg.stepHeat)
80
+          thermalManager.temp_hotend[uiCfg.extruderIndex].target -= uiCfg.stepHeat;
81 81
         else
82
-          thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = 0;
83
-
84
-        thermalManager.start_watching_hotend(uiCfg.curSprayerChoose);
82
+          thermalManager.setTargetHotend(0, uiCfg.extruderIndex);
83
+        thermalManager.start_watching_hotend(uiCfg.extruderIndex);
85 84
       }
86 85
       #if HAS_HEATED_BED
87 86
         else {
88 87
           if ((int)thermalManager.temp_bed.target > uiCfg.stepHeat)
89 88
             thermalManager.temp_bed.target -= uiCfg.stepHeat;
90 89
           else
91
-            thermalManager.temp_bed.target = 0;
90
+            thermalManager.setTargetBed(0);
92 91
 
93 92
           thermalManager.start_watching_bed();
94 93
         }
@@ -98,20 +97,20 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
98 97
     case ID_P_TYPE:
99 98
       if (uiCfg.curTempType == 0) {
100 99
         if (ENABLED(HAS_MULTI_EXTRUDER)) {
101
-          if (uiCfg.curSprayerChoose == 0) {
102
-            uiCfg.curSprayerChoose = 1;
100
+          if (uiCfg.extruderIndex == 0) {
101
+            uiCfg.extruderIndex = 1;
103 102
           }
104
-          else if (uiCfg.curSprayerChoose == 1) {
103
+          else if (uiCfg.extruderIndex == 1) {
105 104
             if (TEMP_SENSOR_BED != 0) {
106 105
               uiCfg.curTempType = 1;
107 106
             }
108 107
             else {
109 108
               uiCfg.curTempType      = 0;
110
-              uiCfg.curSprayerChoose = 0;
109
+              uiCfg.extruderIndex = 0;
111 110
             }
112 111
           }
113 112
         }
114
-        else if (uiCfg.curSprayerChoose == 0) {
113
+        else if (uiCfg.extruderIndex == 0) {
115 114
           if (TEMP_SENSOR_BED != 0)
116 115
             uiCfg.curTempType = 1;
117 116
           else
@@ -119,7 +118,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
119 118
         }
120 119
       }
121 120
       else if (uiCfg.curTempType == 1) {
122
-        uiCfg.curSprayerChoose = 0;
121
+        uiCfg.extruderIndex = 0;
123 122
         uiCfg.curTempType      = 0;
124 123
       }
125 124
       disp_temp_type();
@@ -135,8 +134,8 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
135 134
       break;
136 135
     case ID_P_OFF:
137 136
       if (uiCfg.curTempType == 0) {
138
-        thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = 0;
139
-        thermalManager.start_watching_hotend(uiCfg.curSprayerChoose);
137
+        thermalManager.setTargetHotend(0, uiCfg.extruderIndex);
138
+        thermalManager.start_watching_hotend(uiCfg.extruderIndex);
140 139
       }
141 140
       #if HAS_HEATED_BED
142 141
         else {
@@ -186,7 +185,7 @@ void lv_draw_preHeat() {
186 185
 
187 186
 void disp_temp_type() {
188 187
   if (uiCfg.curTempType == 0) {
189
-    if (uiCfg.curSprayerChoose == 1) {
188
+    if (uiCfg.extruderIndex == 1) {
190 189
     lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru2.bin");
191 190
       if (gCfgItems.multiple_language) {
192 191
         lv_label_set_text(labelType, preheat_menu.ext2);
@@ -217,13 +216,13 @@ void disp_desire_temp() {
217 216
   public_buf_l[0] = '\0';
218 217
 
219 218
   if (uiCfg.curTempType == 0) {
220
-    strcat(public_buf_l, uiCfg.curSprayerChoose < 1 ? preheat_menu.ext1 : preheat_menu.ext2);
221
-    sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius,  (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target);
219
+    strcat(public_buf_l, uiCfg.extruderIndex < 1 ? preheat_menu.ext1 : preheat_menu.ext2);
220
+    sprintf(buf, preheat_menu.value_state, (int)thermalManager.degHotend(uiCfg.extruderIndex), (int)thermalManager.degTargetHotend(uiCfg.extruderIndex));
222 221
   }
223 222
   #if HAS_HEATED_BED
224 223
     else {
225 224
       strcat(public_buf_l, preheat_menu.hotbed);
226
-      sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_bed.celsius,  (int)thermalManager.temp_bed.target);
225
+      sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target);
227 226
     }
228 227
   #endif
229 228
   strcat_P(public_buf_l, PSTR(": "));

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp Переглянути файл

@@ -203,11 +203,11 @@ void lv_draw_printing() {
203 203
 }
204 204
 
205 205
 void disp_ext_temp() {
206
-  sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target);
206
+  sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.degHotend(0), (int)thermalManager.degTargetHotend(0));
207 207
   lv_label_set_text(labelExt1, public_buf_l);
208 208
 
209 209
   #if HAS_MULTI_EXTRUDER
210
-    sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target);
210
+    sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.degHotend(1), (int)thermalManager.degTargetHotend(1));
211 211
     lv_label_set_text(labelExt2, public_buf_l);
212 212
   #endif
213 213
 }

+ 4
- 4
Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp Переглянути файл

@@ -98,10 +98,10 @@ void disp_det_error() {
98 98
 lv_obj_t *e1, *e2, *e3, *bed;
99 99
 void mks_disp_test() {
100 100
   char buf[30] = {0};
101
-  sprintf_P(buf, PSTR("e1:%d"), (int)thermalManager.temp_hotend[0].celsius);
101
+  sprintf_P(buf, PSTR("e1:%d"), (int)thermalManager.degHotend(0));
102 102
   lv_label_set_text(e1, buf);
103 103
   #if HAS_MULTI_HOTEND
104
-    sprintf_P(buf, PSTR("e2:%d"), (int)thermalManager.temp_hotend[1].celsius);
104
+    sprintf_P(buf, PSTR("e2:%d"), (int)thermalManager.degHotend(1));
105 105
     lv_label_set_text(e2, buf);
106 106
   #endif
107 107
   #if HAS_HEATED_BED
@@ -133,12 +133,12 @@ void lv_draw_ready_print() {
133 133
     #if 1
134 134
       e1 = lv_label_create_empty(scr);
135 135
       lv_obj_set_pos(e1, 20, 20);
136
-      sprintf_P(buf, PSTR("e1:  %d"), (int)thermalManager.temp_hotend[0].celsius);
136
+      sprintf_P(buf, PSTR("e1:  %d"), (int)thermalManager.degHotend(0));
137 137
       lv_label_set_text(e1, buf);
138 138
       #if HAS_MULTI_HOTEND
139 139
         e2 = lv_label_create_empty(scr);
140 140
         lv_obj_set_pos(e2, 20, 45);
141
-        sprintf_P(buf, PSTR("e1:  %d"), (int)thermalManager.temp_hotend[1].celsius);
141
+        sprintf_P(buf, PSTR("e1:  %d"), (int)thermalManager.degHotend(1));
142 142
         lv_label_set_text(e2, buf);
143 143
       #endif
144 144
 

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp Переглянути файл

@@ -68,7 +68,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
68 68
       #endif
69 69
       break;
70 70
     case ID_T_FILAMENT:
71
-      uiCfg.desireSprayerTempBak = thermalManager.temp_hotend[uiCfg.curSprayerChoose].target;
71
+      uiCfg.hotendTargetTempBak = thermalManager.degTargetHotend(uiCfg.extruderIndex);
72 72
       lv_draw_filament_change();
73 73
       break;
74 74
     case ID_T_MORE:

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp Переглянути файл

@@ -179,7 +179,7 @@ void gCfgItems_init() {
179 179
 
180 180
 void ui_cfg_init() {
181 181
   uiCfg.curTempType         = 0;
182
-  uiCfg.curSprayerChoose    = 0;
182
+  uiCfg.extruderIndex       = 0;
183 183
   uiCfg.stepHeat            = 10;
184 184
   uiCfg.leveling_first_time = false;
185 185
   uiCfg.para_ui_page        = false;

+ 3
- 3
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h Переглянути файл

@@ -211,9 +211,9 @@ typedef struct {
211 211
 
212 212
 typedef struct {
213 213
   uint8_t curTempType:1,
214
-          curSprayerChoose:3,
214
+          extruderIndex:3,
215 215
           stepHeat:4,
216
-          curSprayerChoose_bak:4;
216
+          extruderIndexBak:4;
217 217
   bool    leveling_first_time:1,
218 218
           para_ui_page:1,
219 219
           configWifi:1,
@@ -246,7 +246,7 @@ typedef struct {
246 246
            filament_loading_time_cnt,
247 247
            filament_unloading_time_cnt;
248 248
   float move_dist;
249
-  float desireSprayerTempBak;
249
+  float hotendTargetTempBak;
250 250
   float current_x_position_bak,
251 251
         current_y_position_bak,
252 252
         current_z_position_bak,

+ 7
- 7
Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp Переглянути файл

@@ -885,9 +885,9 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
885 885
             char *outBuf = (char *)tempBuf;
886 886
             char str_1[16], tbuf[34];
887 887
 
888
-            dtostrf(thermalManager.temp_hotend[0].celsius, 1, 1, tbuf);
888
+            dtostrf(thermalManager.degHotend(0), 1, 1, tbuf);
889 889
             strcat_P(tbuf, PSTR(" /"));
890
-            strcat(tbuf, dtostrf(thermalManager.temp_hotend[0].target, 1, 1, str_1));
890
+            strcat(tbuf, dtostrf(thermalManager.degTargetHotend(0), 1, 1, str_1));
891 891
 
892 892
             const int tlen = strlen(tbuf);
893 893
 
@@ -912,9 +912,9 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
912 912
             strcat_P(outBuf, PSTR(" T1:"));
913 913
             outBuf += 4;
914 914
             #if HAS_MULTI_HOTEND
915
-              strcat(outBuf, dtostrf(thermalManager.temp_hotend[1].celsius, 1, 1, str_1));
915
+              strcat(outBuf, dtostrf(thermalManager.degHotend(1), 1, 1, str_1));
916 916
               strcat_P(outBuf, PSTR(" /"));
917
-              strcat(outBuf, dtostrf(thermalManager.temp_hotend[1].target, 1, 1, str_1));
917
+              strcat(outBuf, dtostrf(thermalManager.degTargetHotend(1), 1, 1, str_1));
918 918
             #else
919 919
               strcat_P(outBuf, PSTR("0 /0"));
920 920
             #endif
@@ -924,15 +924,15 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
924 924
           }
925 925
           else {
926 926
             sprintf_P((char *)tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"),
927
-              (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target,
927
+              (int)thermalManager.degHotend(0), (int)thermalManager.degTargetHotend(0),
928 928
               #if HAS_HEATED_BED
929 929
                 (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target,
930 930
               #else
931 931
                 0, 0,
932 932
               #endif
933
-              (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target,
933
+              (int)thermalManager.degHotend(0), (int)thermalManager.degTargetHotend(0),
934 934
               #if HAS_MULTI_HOTEND
935
-                (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target
935
+                (int)thermalManager.degHotend(1), (int)thermalManager.degTargetHotend(1)
936 936
               #else
937 937
                 0, 0
938 938
               #endif

Завантаження…
Відмінити
Зберегти