Browse Source

Fix EXTENSIBLE_UI compile errors (#12206)

gjdodd 6 years ago
parent
commit
0a549fd1f2

+ 3
- 3
Marlin/src/lcd/extensible_ui/lib/example.cpp View File

@@ -47,9 +47,9 @@ namespace UI {
47 47
   }
48 48
   void onIdle() {}
49 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 53
   void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
54 54
   void onPrintTimerStarted() {}
55 55
   void onPrintTimerPaused() {}

+ 20
- 9
Marlin/src/lcd/extensible_ui/ui_api.cpp View File

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

+ 1
- 1
Marlin/src/libs/buzzer.h View File

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

Loading…
Cancel
Save