Kaynağa Gözat

Fix EXTENSIBLE_UI compile errors (#12206)

gjdodd 6 yıl önce
ebeveyn
işleme
0a549fd1f2

+ 3
- 3
Marlin/src/lcd/extensible_ui/lib/example.cpp Dosyayı Görüntüle

47
   }
47
   }
48
   void onIdle() {}
48
   void onIdle() {}
49
   void onPrinterKilled(const char* msg) {}
49
   void onPrinterKilled(const char* msg) {}
50
-  void onMediaInserted();
51
-  void onMediaError();
52
-  void onMediaRemoved();
50
+  void onMediaInserted() {};
51
+  void onMediaError() {};
52
+  void onMediaRemoved() {};
53
   void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
53
   void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
54
   void onPrintTimerStarted() {}
54
   void onPrintTimerStarted() {}
55
   void onPrintTimerPaused() {}
55
   void onPrintTimerPaused() {}

+ 20
- 9
Marlin/src/lcd/extensible_ui/ui_api.cpp Dosyayı Görüntüle

68
 #if ENABLED(PRINTCOUNTER)
68
 #if ENABLED(PRINTCOUNTER)
69
   #include "../../core/utility.h"
69
   #include "../../core/utility.h"
70
   #include "../../module/printcounter.h"
70
   #include "../../module/printcounter.h"
71
+  #define IFPC(A,B) (A)
72
+#else
73
+  #define IFPC(A,B) (B)  
71
 #endif
74
 #endif
72
 
75
 
73
 #include "ui_api.h"
76
 #include "ui_api.h"
194
     switch (axis) {
197
     switch (axis) {
195
       case X: case Y: case Z: break;
198
       case X: case Y: case Z: break;
196
       case E0: case E1: case E2: case E3: case E4: case E5:
199
       case E0: case E1: case E2: case E3: case E4: case E5:
197
-        active_extruder = axis - E0;
200
+        #if EXTRUDERS > 1
201
+          active_extruder = axis - E0;
202
+        #endif
198
         break;
203
         break;
199
       default: return;
204
       default: return;
200
     }
205
     }
223
       if (extruder != active_extruder)
228
       if (extruder != active_extruder)
224
         tool_change(extruder, 0, no_move);
229
         tool_change(extruder, 0, no_move);
225
     #endif
230
     #endif
226
-    active_extruder = extruder;
231
+    #if EXTRUDERS > 1
232
+      active_extruder = extruder;
233
+    #endif
227
   }
234
   }
228
 
235
 
229
   uint8_t getActiveTool() { return active_extruder + 1; }
236
   uint8_t getActiveTool() { return active_extruder + 1; }
438
   }
445
   }
439
 
446
 
440
   uint32_t getProgress_seconds_elapsed() {
447
   uint32_t getProgress_seconds_elapsed() {
441
-    const duration_t elapsed = print_job_timer.duration();
448
+    const duration_t elapsed = IFPC(print_job_timer.duration(), 0);
442
     return elapsed.value;
449
     return elapsed.value;
443
   }
450
   }
444
 
451
 
493
   }
500
   }
494
 
501
 
495
   void printFile(const char *filename) {
502
   void printFile(const char *filename) {
496
-    IFSD(card.openAndPrintFile(filename), NOOP);
503
+    IFSD(card.openAndPrintFile(filename), 0);
497
   }
504
   }
498
 
505
 
499
   bool isPrintingFromMediaPaused() {
506
   bool isPrintingFromMediaPaused() {
505
   }
512
   }
506
 
513
 
507
   bool isPrinting() {
514
   bool isPrinting() {
508
-    return (planner.movesplanned() || IS_SD_PRINTING() || isPrintingFromMedia());
515
+    return (planner.movesplanned() || IFSD(IS_SD_PRINTING(), false) || isPrintingFromMedia());
509
   }
516
   }
510
 
517
 
511
   bool isMediaInserted() {
518
   bool isMediaInserted() {
515
   void pausePrint() {
522
   void pausePrint() {
516
     #if ENABLED(SDSUPPORT)
523
     #if ENABLED(SDSUPPORT)
517
       card.pauseSDPrint();
524
       card.pauseSDPrint();
518
-      print_job_timer.pause();
525
+      #if ENABLED(PRINTCOUNTER)
526
+        print_job_timer.pause();
527
+      #endif
519
       #if ENABLED(PARK_HEAD_ON_PAUSE)
528
       #if ENABLED(PARK_HEAD_ON_PAUSE)
520
         enqueue_and_echo_commands_P(PSTR("M125"));
529
         enqueue_and_echo_commands_P(PSTR("M125"));
521
       #endif
530
       #endif
529
         enqueue_and_echo_commands_P(PSTR("M24"));
538
         enqueue_and_echo_commands_P(PSTR("M24"));
530
       #else
539
       #else
531
         card.startFileprint();
540
         card.startFileprint();
532
-        print_job_timer.start();
541
+        #if ENABLED(PRINTCOUNTER)
542
+          print_job_timer.start();
543
+        #endif
533
       #endif
544
       #endif
534
       UI::onStatusChanged(PSTR(MSG_PRINTING));
545
       UI::onStatusChanged(PSTR(MSG_PRINTING));
535
     #endif
546
     #endif
659
   static const char printing[] PROGMEM = MSG_PRINTING;
670
   static const char printing[] PROGMEM = MSG_PRINTING;
660
   static const char welcome[] PROGMEM = WELCOME_MSG;
671
   static const char welcome[] PROGMEM = WELCOME_MSG;
661
   PGM_P msg;
672
   PGM_P msg;
662
-  if (print_job_timer.isPaused())
673
+  if (IFPC(print_job_timer.isPaused(), false))
663
     msg = paused;
674
     msg = paused;
664
   #if ENABLED(SDSUPPORT)
675
   #if ENABLED(SDSUPPORT)
665
     else if (card.sdprinting)
676
     else if (card.sdprinting)
666
       return lcd_setstatus(card.longest_filename(), true);
677
       return lcd_setstatus(card.longest_filename(), true);
667
   #endif
678
   #endif
668
-  else if (print_job_timer.isRunning())
679
+  else if (IFPC(print_job_timer.isRunning(), false))
669
     msg = printing;
680
     msg = printing;
670
   else
681
   else
671
     msg = welcome;
682
     msg = welcome;

+ 1
- 1
Marlin/src/libs/buzzer.h Dosyayı Görüntüle

28
 // Make a buzzer and macro
28
 // Make a buzzer and macro
29
 #if ENABLED(LCD_USE_I2C_BUZZER)
29
 #if ENABLED(LCD_USE_I2C_BUZZER)
30
   // BUZZ() will be defined in ultralcd.h
30
   // BUZZ() will be defined in ultralcd.h
31
-#elif PIN_EXISTS(BEEPER) || ENABLED(EXTENSIBLE_UI)
31
+#elif PIN_EXISTS(BEEPER)
32
 
32
 
33
 #include "circularqueue.h"
33
 #include "circularqueue.h"
34
 
34
 

Loading…
İptal
Kaydet