Browse Source

ExtUI additions (#18447)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
InsanityAutomation 4 years ago
parent
commit
3b80690a71
No account linked to committer's email address

+ 4
- 0
Marlin/Configuration.h View File

2121
 //
2121
 //
2122
 //#define EXTENSIBLE_UI
2122
 //#define EXTENSIBLE_UI
2123
 
2123
 
2124
+#if ENABLED(EXTENSIBLE_UI)
2125
+  //#define EXTUI_LOCAL_BEEPER // Enables use of local Beeper pin with external display
2126
+#endif
2127
+
2124
 //=============================================================================
2128
 //=============================================================================
2125
 //=============================== Graphical TFTs ==============================
2129
 //=============================== Graphical TFTs ==============================
2126
 //=============================================================================
2130
 //=============================================================================

+ 3
- 0
Marlin/src/lcd/extui/ui_api.cpp View File

590
   #if HAS_FILAMENT_SENSOR
590
   #if HAS_FILAMENT_SENSOR
591
     bool getFilamentRunoutEnabled()                 { return runout.enabled; }
591
     bool getFilamentRunoutEnabled()                 { return runout.enabled; }
592
     void setFilamentRunoutEnabled(const bool value) { runout.enabled = value; }
592
     void setFilamentRunoutEnabled(const bool value) { runout.enabled = value; }
593
+    bool getFilamentRunoutState()                   { return runout.filament_ran_out; }
594
+    void setFilamentRunoutState(const bool value)   { runout.filament_ran_out = value; }
593
 
595
 
594
     #if HAS_FILAMENT_RUNOUT_DISTANCE
596
     #if HAS_FILAMENT_RUNOUT_DISTANCE
595
       float getFilamentRunoutDistance_mm()                 { return runout.runout_distance(); }
597
       float getFilamentRunoutDistance_mm()                 { return runout.runout_distance(); }
884
   #endif
886
   #endif
885
 
887
 
886
   void injectCommands_P(PGM_P const gcode) { queue.inject_P(gcode); }
888
   void injectCommands_P(PGM_P const gcode) { queue.inject_P(gcode); }
889
+  void injectCommands(char * const gcode)  { queue.inject(gcode); }
887
 
890
 
888
   bool commandsInQueue() { return (planner.movesplanned() || queue.has_commands_queued()); }
891
   bool commandsInQueue() { return (planner.movesplanned() || queue.has_commands_queued()); }
889
 
892
 

+ 3
- 0
Marlin/src/lcd/extui/ui_api.h View File

74
   bool canMove(const axis_t);
74
   bool canMove(const axis_t);
75
   bool canMove(const extruder_t);
75
   bool canMove(const extruder_t);
76
   void injectCommands_P(PGM_P const);
76
   void injectCommands_P(PGM_P const);
77
+  void injectCommands(char * const);
77
   bool commandsInQueue();
78
   bool commandsInQueue();
78
 
79
 
79
   bool isHeaterIdle(const heater_t);
80
   bool isHeaterIdle(const heater_t);
236
   #if HAS_FILAMENT_SENSOR
237
   #if HAS_FILAMENT_SENSOR
237
     bool getFilamentRunoutEnabled();
238
     bool getFilamentRunoutEnabled();
238
     void setFilamentRunoutEnabled(const bool);
239
     void setFilamentRunoutEnabled(const bool);
240
+    bool getFilamentRunoutState();
241
+    void setFilamentRunoutState(const bool);
239
 
242
 
240
     #if HAS_FILAMENT_RUNOUT_DISTANCE
243
     #if HAS_FILAMENT_RUNOUT_DISTANCE
241
       float getFilamentRunoutDistance_mm();
244
       float getFilamentRunoutDistance_mm();

+ 2
- 1
Marlin/src/libs/buzzer.cpp View File

66
         CRITICAL_SECTION_START();
66
         CRITICAL_SECTION_START();
67
         ExtUI::onPlayTone(state.tone.frequency, state.tone.duration);
67
         ExtUI::onPlayTone(state.tone.frequency, state.tone.duration);
68
         CRITICAL_SECTION_END();
68
         CRITICAL_SECTION_END();
69
-      #elif ENABLED(SPEAKER)
69
+      #endif
70
+      #if ENABLED(SPEAKER) && (DISABLED(EXTENSIBLE_UI) || ENABLED(EXTUI_LOCAL_BEEPER))
70
         CRITICAL_SECTION_START();
71
         CRITICAL_SECTION_START();
71
         ::tone(BEEPER_PIN, state.tone.frequency, state.tone.duration);
72
         ::tone(BEEPER_PIN, state.tone.frequency, state.tone.duration);
72
         CRITICAL_SECTION_END();
73
         CRITICAL_SECTION_END();

Loading…
Cancel
Save