Bläddra i källkod

Use IS_SD_PRINTING() more

Scott Lahteine 6 år sedan
förälder
incheckning
488a17b3f5

+ 2
- 1
Marlin/src/feature/pause.cpp Visa fil

@@ -357,11 +357,12 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
357 357
 
358 358
   // Pause the print job and timer
359 359
   #if ENABLED(SDSUPPORT)
360
-    if (card.sdprinting) {
360
+    if (IS_SD_PRINTING()) {
361 361
       card.pauseSDPrint();
362 362
       ++did_pause_print; // Indicate SD pause also
363 363
     }
364 364
   #endif
365
+
365 366
   print_job_timer.pause();
366 367
 
367 368
   // Save current position

+ 2
- 2
Marlin/src/gcode/queue.cpp Visa fil

@@ -749,7 +749,7 @@ inline void get_serial_commands() {
749 749
 
750 750
           card.printingHasFinished();
751 751
 
752
-          if (card.sdprinting)
752
+          if (IS_SD_PRINTING())
753 753
             sd_count = 0; // If a sub-file was printing, continue from call point
754 754
           else {
755 755
             SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
@@ -888,7 +888,7 @@ void advance_command_queue() {
888 888
     else {
889 889
       gcode.process_next_command();
890 890
       #if ENABLED(POWER_LOSS_RECOVERY)
891
-        if (card.cardOK && card.sdprinting) save_job_recovery_info();
891
+        if (card.cardOK && IS_SD_PRINTING()) save_job_recovery_info();
892 892
       #endif
893 893
     }
894 894
 

+ 1
- 1
Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp Visa fil

@@ -226,7 +226,7 @@ void GcodeSuite::M30() {
226 226
  *
227 227
  */
228 228
 void GcodeSuite::M32() {
229
-  if (card.sdprinting) planner.synchronize();
229
+  if (IS_SD_PRINTING()) planner.synchronize();
230 230
 
231 231
   if (card.cardOK) {
232 232
     const bool call_procedure = parser.boolval('P');

+ 2
- 2
Marlin/src/lcd/extensible_ui/ui_api.cpp Visa fil

@@ -570,7 +570,7 @@ namespace UI {
570 570
   }
571 571
 
572 572
   bool isPrintingFromMediaPaused() {
573
-    return IFSD(isPrintingFromMedia() && !card.sdprinting, false);
573
+    return IFSD(isPrintingFromMedia() && !IS_SD_PRINTING(), false);
574 574
   }
575 575
 
576 576
   bool isPrintingFromMedia() {
@@ -728,7 +728,7 @@ void lcd_reset_status() {
728 728
   if (print_job_timer.isPaused())
729 729
     msg = paused;
730 730
   #if ENABLED(SDSUPPORT)
731
-    else if (card.sdprinting)
731
+    else if (IS_SD_PRINTING())
732 732
       return lcd_setstatus(card.longest_filename(), true);
733 733
   #endif
734 734
   else if (print_job_timer.isRunning())

+ 2
- 2
Marlin/src/lcd/malyanlcd.cpp Visa fil

@@ -444,13 +444,13 @@ void lcd_update() {
444 444
     // If there was a print in progress, we need to emit the final
445 445
     // print status as {TQ:100}. Reset last percent done so a new print will
446 446
     // issue a percent of 0.
447
-    const uint8_t percent_done = card.sdprinting ? card.percentDone() : last_printing_status ? 100 : 0;
447
+    const uint8_t percent_done = IS_SD_PRINTING() ? card.percentDone() : last_printing_status ? 100 : 0;
448 448
     if (percent_done != last_percent_done) {
449 449
       char message_buffer[10];
450 450
       sprintf_P(message_buffer, PSTR("{TQ:%03i}"), percent_done);
451 451
       write_to_lcd(message_buffer);
452 452
       last_percent_done = percent_done;
453
-      last_printing_status = card.sdprinting;
453
+      last_printing_status = IS_SD_PRINTING();
454 454
     }
455 455
   #endif
456 456
 }

+ 1
- 1
Marlin/src/lcd/menu/menu_main.cpp Visa fil

@@ -88,7 +88,7 @@ void menu_main() {
88 88
   #if ENABLED(SDSUPPORT)
89 89
     if (card.cardOK) {
90 90
       if (card.isFileOpen()) {
91
-        if (card.sdprinting)
91
+        if (IS_SD_PRINTING())
92 92
           MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause);
93 93
         else
94 94
           MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume);

+ 1
- 1
Marlin/src/lcd/ultralcd.cpp Visa fil

@@ -432,7 +432,7 @@ void lcd_reset_status() {
432 432
   if (print_job_timer.isPaused())
433 433
     msg = paused;
434 434
   #if ENABLED(SDSUPPORT)
435
-    else if (card.sdprinting)
435
+    else if (IS_SD_PRINTING())
436 436
       return lcd_setstatus(card.longest_filename(), true);
437 437
   #endif
438 438
   else if (print_job_timer.isRunning())

Laddar…
Avbryt
Spara