瀏覽代碼

Use IS_SD_PRINTING() more

Scott Lahteine 6 年之前
父節點
當前提交
488a17b3f5

+ 2
- 1
Marlin/src/feature/pause.cpp 查看文件

357
 
357
 
358
   // Pause the print job and timer
358
   // Pause the print job and timer
359
   #if ENABLED(SDSUPPORT)
359
   #if ENABLED(SDSUPPORT)
360
-    if (card.sdprinting) {
360
+    if (IS_SD_PRINTING()) {
361
       card.pauseSDPrint();
361
       card.pauseSDPrint();
362
       ++did_pause_print; // Indicate SD pause also
362
       ++did_pause_print; // Indicate SD pause also
363
     }
363
     }
364
   #endif
364
   #endif
365
+
365
   print_job_timer.pause();
366
   print_job_timer.pause();
366
 
367
 
367
   // Save current position
368
   // Save current position

+ 2
- 2
Marlin/src/gcode/queue.cpp 查看文件

749
 
749
 
750
           card.printingHasFinished();
750
           card.printingHasFinished();
751
 
751
 
752
-          if (card.sdprinting)
752
+          if (IS_SD_PRINTING())
753
             sd_count = 0; // If a sub-file was printing, continue from call point
753
             sd_count = 0; // If a sub-file was printing, continue from call point
754
           else {
754
           else {
755
             SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
755
             SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
888
     else {
888
     else {
889
       gcode.process_next_command();
889
       gcode.process_next_command();
890
       #if ENABLED(POWER_LOSS_RECOVERY)
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
       #endif
892
       #endif
893
     }
893
     }
894
 
894
 

+ 1
- 1
Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp 查看文件

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

+ 2
- 2
Marlin/src/lcd/extensible_ui/ui_api.cpp 查看文件

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

+ 2
- 2
Marlin/src/lcd/malyanlcd.cpp 查看文件

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

+ 1
- 1
Marlin/src/lcd/menu/menu_main.cpp 查看文件

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

+ 1
- 1
Marlin/src/lcd/ultralcd.cpp 查看文件

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

Loading…
取消
儲存