Browse Source

Make KEEPALIVE_STATE a scoped auto-restore (#14446)

Scott Lahteine 6 years ago
parent
commit
d16954dc88
No account linked to committer's email address

+ 3
- 20
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

768
             ui.wait_for_release();
768
             ui.wait_for_release();
769
             ui.quick_feedback();
769
             ui.quick_feedback();
770
             ui.release();
770
             ui.release();
771
-            restore_ubl_active_state_and_leave();
771
+            return restore_ubl_active_state_and_leave();
772
-            return;
773
           }
772
           }
774
         #endif
773
         #endif
775
 
774
 
844
     float unified_bed_leveling::measure_point_with_encoder() {
843
     float unified_bed_leveling::measure_point_with_encoder() {
845
       KEEPALIVE_STATE(PAUSED_FOR_USER);
844
       KEEPALIVE_STATE(PAUSED_FOR_USER);
846
       move_z_with_encoder(0.01f);
845
       move_z_with_encoder(0.01f);
847
-      KEEPALIVE_STATE(IN_HANDLER);
848
       return current_position[Z_AXIS];
846
       return current_position[Z_AXIS];
849
     }
847
     }
850
 
848
 
889
       return thickness;
887
       return thickness;
890
     }
888
     }
891
 
889
 
892
-    void abort_manual_probe_remaining_mesh() {
893
-      SERIAL_ECHOLNPGM("\nMesh only partially populated.");
894
-      do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
895
-      ui.release();
896
-      KEEPALIVE_STATE(IN_HANDLER);
897
-      ui.quick_feedback();
898
-      ubl.restore_ubl_active_state_and_leave();
899
-    }
900
-
901
     void unified_bed_leveling::manually_probe_remaining_mesh(const float &rx, const float &ry, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) {
890
     void unified_bed_leveling::manually_probe_remaining_mesh(const float &rx, const float &ry, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) {
902
 
891
 
903
       ui.capture();
892
       ui.capture();
939
           SERIAL_ECHOLNPGM("\nMesh only partially populated.");
928
           SERIAL_ECHOLNPGM("\nMesh only partially populated.");
940
           do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
929
           do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
941
           ui.release();
930
           ui.release();
942
-          KEEPALIVE_STATE(IN_HANDLER);
931
+          return restore_ubl_active_state_and_leave();
943
-          restore_ubl_active_state_and_leave();
944
-          return;
945
         }
932
         }
946
 
933
 
947
         z_values[location.x_index][location.y_index] = current_position[Z_AXIS] - thick;
934
         z_values[location.x_index][location.y_index] = current_position[Z_AXIS] - thick;
957
       if (do_ubl_mesh_map) display_map(g29_map_type);  // show user where we're probing
944
       if (do_ubl_mesh_map) display_map(g29_map_type);  // show user where we're probing
958
 
945
 
959
       restore_ubl_active_state_and_leave();
946
       restore_ubl_active_state_and_leave();
960
-      KEEPALIVE_STATE(IN_HANDLER);
961
       do_blocking_move_to(rx, ry, Z_CLEARANCE_DEPLOY_PROBE);
947
       do_blocking_move_to(rx, ry, Z_CLEARANCE_DEPLOY_PROBE);
962
     }
948
     }
963
 
949
 
1046
 
1032
 
1047
         if (!lcd_map_control) ui.return_to_status();                // Just editing a single point? Return to status
1033
         if (!lcd_map_control) ui.return_to_status();                // Just editing a single point? Return to status
1048
 
1034
 
1049
-        if (click_and_hold(abort_fine_tune)) goto FINE_TUNE_EXIT;   // If the click is held down, abort editing
1035
+        if (click_and_hold(abort_fine_tune)) break;                 // Button held down? Abort editing
1050
 
1036
 
1051
         z_values[location.x_index][location.y_index] = new_z;       // Save the updated Z value
1037
         z_values[location.x_index][location.y_index] = new_z;       // Save the updated Z value
1052
         #if ENABLED(EXTENSIBLE_UI)
1038
         #if ENABLED(EXTENSIBLE_UI)
1058
 
1044
 
1059
       } while (location.x_index >= 0 && --g29_repetition_cnt > 0);
1045
       } while (location.x_index >= 0 && --g29_repetition_cnt > 0);
1060
 
1046
 
1061
-      FINE_TUNE_EXIT:
1062
-
1063
       ui.release();
1047
       ui.release();
1064
-      KEEPALIVE_STATE(IN_HANDLER);
1065
 
1048
 
1066
       if (do_ubl_mesh_map) display_map(g29_map_type);
1049
       if (do_ubl_mesh_map) display_map(g29_map_type);
1067
       restore_ubl_active_state_and_leave();
1050
       restore_ubl_active_state_and_leave();

+ 0
- 3
Marlin/src/feature/pause.cpp View File

189
       #endif
189
       #endif
190
       idle(true);
190
       idle(true);
191
     }
191
     }
192
-    KEEPALIVE_STATE(IN_HANDLER);
193
   }
192
   }
194
 
193
 
195
   #if HAS_LCD_MENU
194
   #if HAS_LCD_MENU
278
           wait_for_user = false;
277
           wait_for_user = false;
279
           lcd_pause_show_message(PAUSE_MESSAGE_OPTION);
278
           lcd_pause_show_message(PAUSE_MESSAGE_OPTION);
280
           while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) idle(true);
279
           while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) idle(true);
281
-          KEEPALIVE_STATE(IN_HANDLER);
282
         }
280
         }
283
       #endif
281
       #endif
284
 
282
 
580
     extruder_duplication_enabled = saved_ext_dup_mode;
578
     extruder_duplication_enabled = saved_ext_dup_mode;
581
     stepper.set_directions();
579
     stepper.set_directions();
582
   #endif
580
   #endif
583
-  KEEPALIVE_STATE(IN_HANDLER);
584
 }
581
 }
585
 
582
 
586
 /**
583
 /**

+ 8
- 43
Marlin/src/feature/prusa_MMU2/mmu2.cpp View File

47
 
47
 
48
 #define MMU_TODELAY 100
48
 #define MMU_TODELAY 100
49
 #define MMU_TIMEOUT 10
49
 #define MMU_TIMEOUT 10
50
-#define MMU_CMD_TIMEOUT 60000ul //5min timeout for mmu commands (except P0)
50
+#define MMU_CMD_TIMEOUT 60000ul // 5min timeout for mmu commands (except P0)
51
-#define MMU_P0_TIMEOUT 3000ul //timeout for P0 command: 3seconds
51
+#define MMU_P0_TIMEOUT 3000ul   // Timeout for P0 command: 3seconds
52
 
52
 
53
 #define MMU_CMD_NONE 0
53
 #define MMU_CMD_NONE 0
54
 #define MMU_CMD_T0   0x10
54
 #define MMU_CMD_T0   0x10
327
   }
327
   }
328
 }
328
 }
329
 
329
 
330
-
331
 /**
330
 /**
332
  * Check if MMU was started
331
  * Check if MMU was started
333
  */
332
  */
340
   return false;
339
   return false;
341
 }
340
 }
342
 
341
 
343
-
344
 /**
342
 /**
345
  * Check if the data received ends with the given string.
343
  * Check if the data received ends with the given string.
346
  */
344
  */
373
   return true;
371
   return true;
374
 }
372
 }
375
 
373
 
376
-
377
 /**
374
 /**
378
  * Transfer data to MMU, no argument
375
  * Transfer data to MMU, no argument
379
  */
376
  */
385
   last_request = millis();
382
   last_request = millis();
386
 }
383
 }
387
 
384
 
388
-
389
 /**
385
 /**
390
  * Transfer data to MMU, single argument
386
  * Transfer data to MMU, single argument
391
  */
387
  */
397
   last_request = millis();
393
   last_request = millis();
398
 }
394
 }
399
 
395
 
400
-
401
 /**
396
 /**
402
  * Transfer data to MMU, two arguments
397
  * Transfer data to MMU, two arguments
403
  */
398
  */
409
   last_request = millis();
404
   last_request = millis();
410
 }
405
 }
411
 
406
 
412
-
413
 /**
407
 /**
414
  * Empty the rx buffer
408
  * Empty the rx buffer
415
  */
409
  */
418
   rx_buffer[0] = '\0';
412
   rx_buffer[0] = '\0';
419
 }
413
 }
420
 
414
 
421
-
422
 /**
415
 /**
423
  * Check if we received 'ok' from MMU
416
  * Check if we received 'ok' from MMU
424
  */
417
  */
430
   return false;
423
   return false;
431
 }
424
 }
432
 
425
 
433
-
434
 /**
426
 /**
435
  * Check if MMU has compatible firmware
427
  * Check if MMU has compatible firmware
436
  */
428
  */
443
   }
435
   }
444
 }
436
 }
445
 
437
 
446
-
447
 /**
438
 /**
448
  * Handle tool change
439
  * Handle tool change
449
  */
440
  */
455
 
446
 
456
   if (index != extruder) {
447
   if (index != extruder) {
457
 
448
 
458
-    KEEPALIVE_STATE(IN_HANDLER);
459
     disable_E0();
449
     disable_E0();
460
     ui.status_printf_P(0, PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
450
     ui.status_printf_P(0, PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
461
 
451
 
462
     command(MMU_CMD_T0 + index);
452
     command(MMU_CMD_T0 + index);
463
 
453
 
464
     manage_response(true, true);
454
     manage_response(true, true);
465
-    KEEPALIVE_STATE(IN_HANDLER);
466
 
455
 
467
     command(MMU_CMD_C0);
456
     command(MMU_CMD_C0);
468
     extruder = index; //filament change is finished
457
     extruder = index; //filament change is finished
474
     SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(extruder));
463
     SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(extruder));
475
 
464
 
476
     ui.reset_status();
465
     ui.reset_status();
477
-    KEEPALIVE_STATE(NOT_BUSY);
478
   }
466
   }
479
 
467
 
480
   set_runout_valid(true);
468
   set_runout_valid(true);
481
 }
469
 }
482
 
470
 
483
-
484
 /**
471
 /**
485
  *
472
  *
486
  * Handle special T?/Tx/Tc commands
473
  * Handle special T?/Tx/Tc commands
497
   #if ENABLED(MMU2_MENUS)
484
   #if ENABLED(MMU2_MENUS)
498
 
485
 
499
     set_runout_valid(false);
486
     set_runout_valid(false);
500
-    KEEPALIVE_STATE(IN_HANDLER);
501
 
487
 
502
     switch (*special) {
488
     switch (*special) {
503
       case '?': {
489
       case '?': {
526
       } break;
512
       } break;
527
     }
513
     }
528
 
514
 
529
-    KEEPALIVE_STATE(NOT_BUSY);
530
-
531
     set_runout_valid(true);
515
     set_runout_valid(true);
532
 
516
 
533
   #endif
517
   #endif
534
 }
518
 }
535
 
519
 
536
-
537
 /**
520
 /**
538
  * Set next command
521
  * Set next command
539
  */
522
  */
543
   ready = false;
526
   ready = false;
544
 }
527
 }
545
 
528
 
546
-
547
 /**
529
 /**
548
  * Wait for response from MMU
530
  * Wait for response from MMU
549
  */
531
  */
561
   return ret;
543
   return ret;
562
 }
544
 }
563
 
545
 
564
-
565
 /**
546
 /**
566
  * Wait for response and deal with timeout if nexcessary
547
  * Wait for response and deal with timeout if nexcessary
567
  */
548
  */
568
-void MMU2::manage_response(bool move_axes, bool turn_off_nozzle) {
549
+void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
569
 
550
 
570
   bool response = false;
551
   bool response = false;
571
   mmu_print_saved = false;
552
   mmu_print_saved = false;
573
   float resume_position[XYZE];
554
   float resume_position[XYZE];
574
   int16_t resume_hotend_temp;
555
   int16_t resume_hotend_temp;
575
 
556
 
557
+  KEEPALIVE_STATE(PAUSED_FOR_USER);
558
+
576
   while (!response) {
559
   while (!response) {
577
 
560
 
578
-    response = get_response(); //wait for "ok" from mmu
561
+    response = get_response(); // wait for "ok" from mmu
579
 
562
 
580
-    if (!response) { //no "ok" was received in reserved time frame, user will fix the issue on mmu unit
563
+    if (!response) {          // No "ok" was received in reserved time frame, user will fix the issue on mmu unit
581
-      if (!mmu_print_saved) { //first occurence, we are saving current position, park print head in certain position and disable nozzle heater
564
+      if (!mmu_print_saved) { // First occurrence. Save current position, park print head, disable nozzle heater.
582
 
565
 
583
         planner.synchronize();
566
         planner.synchronize();
584
 
567
 
600
         BUZZ(100, 659);
583
         BUZZ(100, 659);
601
         BUZZ(300, 440);
584
         BUZZ(300, 440);
602
         BUZZ(100, 659);
585
         BUZZ(100, 659);
603
-
604
-        KEEPALIVE_STATE(PAUSED_FOR_USER);
605
       }
586
       }
606
     }
587
     }
607
     else if (mmu_print_saved) {
588
     else if (mmu_print_saved) {
608
       SERIAL_ECHOLNPGM("MMU starts responding\n");
589
       SERIAL_ECHOLNPGM("MMU starts responding\n");
609
-      KEEPALIVE_STATE(IN_HANDLER);
610
 
590
 
611
       if (turn_off_nozzle && resume_hotend_temp) {
591
       if (turn_off_nozzle && resume_hotend_temp) {
612
         thermalManager.setTargetHotend(resume_hotend_temp, active_extruder);
592
         thermalManager.setTargetHotend(resume_hotend_temp, active_extruder);
639
 void MMU2::set_filament_type(uint8_t index, uint8_t filamentType) {
619
 void MMU2::set_filament_type(uint8_t index, uint8_t filamentType) {
640
   if (!enabled) return;
620
   if (!enabled) return;
641
 
621
 
642
-  KEEPALIVE_STATE(IN_HANDLER);
643
-
644
   cmd_arg = filamentType;
622
   cmd_arg = filamentType;
645
   command(MMU_CMD_F0 + index);
623
   command(MMU_CMD_F0 + index);
646
 
624
 
647
   manage_response(true, true);
625
   manage_response(true, true);
648
-
649
-  KEEPALIVE_STATE(NOT_BUSY);
650
 }
626
 }
651
 
627
 
652
 void MMU2::filament_runout() {
628
 void MMU2::filament_runout() {
679
       return false;
655
       return false;
680
     }
656
     }
681
     else {
657
     else {
682
-      KEEPALIVE_STATE(IN_HANDLER);
683
-
684
       command(MMU_CMD_T0 + index);
658
       command(MMU_CMD_T0 + index);
685
       manage_response(true, true);
659
       manage_response(true, true);
686
       command(MMU_CMD_C0);
660
       command(MMU_CMD_C0);
692
       load_to_nozzle();
666
       load_to_nozzle();
693
 
667
 
694
       BUZZ(200, 404);
668
       BUZZ(200, 404);
695
-
696
-      KEEPALIVE_STATE(NOT_BUSY);
697
       return true;
669
       return true;
698
     }
670
     }
699
   }
671
   }
721
       return false;
693
       return false;
722
     }
694
     }
723
 
695
 
724
-    KEEPALIVE_STATE(IN_HANDLER);
725
     LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT);
696
     LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT);
726
     const bool saved_e_relative_mode = gcode.axis_relative_modes[E_AXIS];
697
     const bool saved_e_relative_mode = gcode.axis_relative_modes[E_AXIS];
727
     gcode.axis_relative_modes[E_AXIS] = true;
698
     gcode.axis_relative_modes[E_AXIS] = true;
757
 
728
 
758
     BUZZ(200, 404);
729
     BUZZ(200, 404);
759
 
730
 
760
-    KEEPALIVE_STATE(NOT_BUSY);
761
-
762
     gcode.axis_relative_modes[E_AXIS] = saved_e_relative_mode;
731
     gcode.axis_relative_modes[E_AXIS] = saved_e_relative_mode;
763
 
732
 
764
     disable_E0();
733
     disable_E0();
781
       return false;
750
       return false;
782
     }
751
     }
783
 
752
 
784
-    KEEPALIVE_STATE(IN_HANDLER);
785
-
786
     filament_ramming();
753
     filament_ramming();
787
 
754
 
788
     command(MMU_CMD_U0);
755
     command(MMU_CMD_U0);
795
 
762
 
796
     set_runout_valid(false);
763
     set_runout_valid(false);
797
 
764
 
798
-    KEEPALIVE_STATE(NOT_BUSY);
799
-
800
     return true;
765
     return true;
801
   }
766
   }
802
 
767
 

+ 1
- 1
Marlin/src/feature/prusa_MMU2/mmu2.h View File

63
 
63
 
64
   static void command(const uint8_t cmd);
64
   static void command(const uint8_t cmd);
65
   static bool get_response(void);
65
   static bool get_response(void);
66
-  static void manage_response(bool move_axes, bool turn_off_nozzle);
66
+  static void manage_response(const bool move_axes, const bool turn_off_nozzle);
67
 
67
 
68
   #if HAS_LCD_MENU && ENABLED(MMU2_MENUS)
68
   #if HAS_LCD_MENU && ENABLED(MMU2_MENUS)
69
     static void load_to_nozzle();
69
     static void load_to_nozzle();

+ 0
- 2
Marlin/src/gcode/bedlevel/abl/G29.cpp View File

978
 
978
 
979
   if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G29");
979
   if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G29");
980
 
980
 
981
-  KEEPALIVE_STATE(IN_HANDLER);
982
-
983
   if (planner.leveling_active)
981
   if (planner.leveling_active)
984
     sync_plan_position();
982
     sync_plan_position();
985
 
983
 

+ 2
- 2
Marlin/src/gcode/config/M43.cpp View File

320
     }
320
     }
321
 
321
 
322
     #if HAS_RESUME_CONTINUE
322
     #if HAS_RESUME_CONTINUE
323
+      KEEPALIVE_STATE(PAUSED_FOR_USER);
323
       wait_for_user = true;
324
       wait_for_user = true;
324
       #if ENABLED(HOST_PROMPT_SUPPORT)
325
       #if ENABLED(HOST_PROMPT_SUPPORT)
325
         host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), PSTR("Continue"));
326
         host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), PSTR("Continue"));
326
       #endif
327
       #endif
327
-      KEEPALIVE_STATE(PAUSED_FOR_USER);
328
     #endif
328
     #endif
329
 
329
 
330
     for (;;) {
330
     for (;;) {
346
       }
346
       }
347
 
347
 
348
       #if HAS_RESUME_CONTINUE
348
       #if HAS_RESUME_CONTINUE
349
-        if (!wait_for_user) { KEEPALIVE_STATE(IN_HANDLER); break; }
349
+        if (!wait_for_user) break;
350
       #endif
350
       #endif
351
 
351
 
352
       safe_delay(200);
352
       safe_delay(200);

+ 1
- 3
Marlin/src/gcode/gcode.cpp View File

430
         //case 191: M191(); break;                                // M191: Wait for chamber temperature to reach target
430
         //case 191: M191(); break;                                // M191: Wait for chamber temperature to reach target
431
       #endif
431
       #endif
432
 
432
 
433
-      case 105: M105(); KEEPALIVE_STATE(NOT_BUSY); return;        // M105: Report Temperatures (and say "ok")
433
+      case 105: M105(); return;                                   // M105: Report Temperatures (and say "ok")
434
 
434
 
435
       #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR
435
       #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR
436
         case 155: M155(); break;                                  // M155: Set temperature auto-report interval
436
         case 155: M155(); break;                                  // M155: Set temperature auto-report interval
796
     default: parser.unknown_command_error();
796
     default: parser.unknown_command_error();
797
   }
797
   }
798
 
798
 
799
-  KEEPALIVE_STATE(NOT_BUSY);
800
-
801
   if (!no_ok) queue.ok_to_send();
799
   if (!no_ok) queue.ok_to_send();
802
 }
800
 }
803
 
801
 

+ 2
- 2
Marlin/src/gcode/gcode.h View File

339
 
339
 
340
     static void host_keepalive();
340
     static void host_keepalive();
341
 
341
 
342
-    #define KEEPALIVE_STATE(n) gcode.busy_state = gcode.n
342
+    #define KEEPALIVE_STATE(N) REMEMBER(_KA_, gcode.busy_state, gcode.N)
343
   #else
343
   #else
344
-    #define KEEPALIVE_STATE(n) NOOP
344
+    #define KEEPALIVE_STATE(N) NOOP
345
   #endif
345
   #endif
346
 
346
 
347
   static void dwell(millis_t time);
347
   static void dwell(millis_t time);

+ 0
- 1
Marlin/src/gcode/lcd/M0_M1.cpp View File

118
   #endif
118
   #endif
119
 
119
 
120
   wait_for_user = false;
120
   wait_for_user = false;
121
-  KEEPALIVE_STATE(IN_HANDLER);
122
 }
121
 }
123
 
122
 
124
 #endif // HAS_RESUME_CONTINUE
123
 #endif // HAS_RESUME_CONTINUE

+ 0
- 4
Marlin/src/gcode/temperature/M303.cpp View File

62
   #endif
62
   #endif
63
 
63
 
64
   thermalManager.PID_autotune(temp, e, c, u);
64
   thermalManager.PID_autotune(temp, e, c, u);
65
-
66
-  #if DISABLED(BUSY_WHILE_HEATING)
67
-    KEEPALIVE_STATE(IN_HANDLER);
68
-  #endif
69
 }
65
 }
70
 
66
 
71
 #endif // HAS_PID_HEATING
67
 #endif // HAS_PID_HEATING

+ 0
- 1
Marlin/src/lcd/menu/menu_delta_calibrate.cpp View File

56
       host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), PSTR("Continue"));
56
       host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), PSTR("Continue"));
57
     #endif
57
     #endif
58
     while (wait_for_user) idle();
58
     while (wait_for_user) idle();
59
-    KEEPALIVE_STATE(IN_HANDLER);
60
     ui.goto_previous_screen_no_defer();
59
     ui.goto_previous_screen_no_defer();
61
     return current_position[Z_AXIS];
60
     return current_position[Z_AXIS];
62
   }
61
   }

+ 1
- 1
Marlin/src/module/probe.cpp View File

355
       #endif
355
       #endif
356
       while (wait_for_user) idle();
356
       while (wait_for_user) idle();
357
       ui.reset_status();
357
       ui.reset_status();
358
-      KEEPALIVE_STATE(IN_HANDLER);
358
+
359
     } while(
359
     } while(
360
       #if ENABLED(PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED)
360
       #if ENABLED(PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED)
361
         true
361
         true

+ 0
- 15
Marlin/src/module/temperature.cpp View File

2925
       #endif
2925
       #endif
2926
 
2926
 
2927
       #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
2927
       #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
2928
-        const GcodeSuite::MarlinBusyState old_busy_state = gcode.busy_state;
2929
         KEEPALIVE_STATE(NOT_BUSY);
2928
         KEEPALIVE_STATE(NOT_BUSY);
2930
       #endif
2929
       #endif
2931
 
2930
 
3019
         #endif
3018
         #endif
3020
       }
3019
       }
3021
 
3020
 
3022
-      #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
3023
-        gcode.busy_state = old_busy_state;
3024
-      #endif
3025
-
3026
       return wait_for_heatup;
3021
       return wait_for_heatup;
3027
     }
3022
     }
3028
 
3023
 
3058
       millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
3053
       millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
3059
 
3054
 
3060
       #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
3055
       #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
3061
-        const GcodeSuite::MarlinBusyState old_busy_state = gcode.busy_state;
3062
         KEEPALIVE_STATE(NOT_BUSY);
3056
         KEEPALIVE_STATE(NOT_BUSY);
3063
       #endif
3057
       #endif
3064
 
3058
 
3145
 
3139
 
3146
       if (wait_for_heatup) ui.reset_status();
3140
       if (wait_for_heatup) ui.reset_status();
3147
 
3141
 
3148
-      #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
3149
-        gcode.busy_state = old_busy_state;
3150
-      #endif
3151
-
3152
       return wait_for_heatup;
3142
       return wait_for_heatup;
3153
     }
3143
     }
3154
 
3144
 
3179
       millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
3169
       millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
3180
 
3170
 
3181
       #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
3171
       #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
3182
-        const GcodeSuite::MarlinBusyState old_busy_state = gcode.busy_state;
3183
         KEEPALIVE_STATE(NOT_BUSY);
3172
         KEEPALIVE_STATE(NOT_BUSY);
3184
       #endif
3173
       #endif
3185
 
3174
 
3247
 
3236
 
3248
       if (wait_for_heatup) ui.reset_status();
3237
       if (wait_for_heatup) ui.reset_status();
3249
 
3238
 
3250
-      #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
3251
-        gcode.busy_state = old_busy_state;
3252
-      #endif
3253
-
3254
       return wait_for_heatup;
3239
       return wait_for_heatup;
3255
     }
3240
     }
3256
 
3241
 

Loading…
Cancel
Save