Browse Source

ExtUI additions (#18447)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
vanilla_fb_2.0.x
InsanityAutomation 5 years ago
committed by GitHub
parent
commit
3b80690a71
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      Marlin/Configuration.h
  2. 3
      Marlin/src/lcd/extui/ui_api.cpp
  3. 3
      Marlin/src/lcd/extui/ui_api.h
  4. 3
      Marlin/src/libs/buzzer.cpp

4
Marlin/Configuration.h

@ -2121,6 +2121,10 @@
// //
//#define EXTENSIBLE_UI //#define EXTENSIBLE_UI
#if ENABLED(EXTENSIBLE_UI)
//#define EXTUI_LOCAL_BEEPER // Enables use of local Beeper pin with external display
#endif
//============================================================================= //=============================================================================
//=============================== Graphical TFTs ============================== //=============================== Graphical TFTs ==============================
//============================================================================= //=============================================================================

3
Marlin/src/lcd/extui/ui_api.cpp

@ -590,6 +590,8 @@ namespace ExtUI {
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
bool getFilamentRunoutEnabled() { return runout.enabled; } bool getFilamentRunoutEnabled() { return runout.enabled; }
void setFilamentRunoutEnabled(const bool value) { runout.enabled = value; } void setFilamentRunoutEnabled(const bool value) { runout.enabled = value; }
bool getFilamentRunoutState() { return runout.filament_ran_out; }
void setFilamentRunoutState(const bool value) { runout.filament_ran_out = value; }
#if HAS_FILAMENT_RUNOUT_DISTANCE #if HAS_FILAMENT_RUNOUT_DISTANCE
float getFilamentRunoutDistance_mm() { return runout.runout_distance(); } float getFilamentRunoutDistance_mm() { return runout.runout_distance(); }
@ -884,6 +886,7 @@ namespace ExtUI {
#endif #endif
void injectCommands_P(PGM_P const gcode) { queue.inject_P(gcode); } void injectCommands_P(PGM_P const gcode) { queue.inject_P(gcode); }
void injectCommands(char * const gcode) { queue.inject(gcode); }
bool commandsInQueue() { return (planner.movesplanned() || queue.has_commands_queued()); } bool commandsInQueue() { return (planner.movesplanned() || queue.has_commands_queued()); }

3
Marlin/src/lcd/extui/ui_api.h

@ -74,6 +74,7 @@ namespace ExtUI {
bool canMove(const axis_t); bool canMove(const axis_t);
bool canMove(const extruder_t); bool canMove(const extruder_t);
void injectCommands_P(PGM_P const); void injectCommands_P(PGM_P const);
void injectCommands(char * const);
bool commandsInQueue(); bool commandsInQueue();
bool isHeaterIdle(const heater_t); bool isHeaterIdle(const heater_t);
@ -236,6 +237,8 @@ namespace ExtUI {
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
bool getFilamentRunoutEnabled(); bool getFilamentRunoutEnabled();
void setFilamentRunoutEnabled(const bool); void setFilamentRunoutEnabled(const bool);
bool getFilamentRunoutState();
void setFilamentRunoutState(const bool);
#if HAS_FILAMENT_RUNOUT_DISTANCE #if HAS_FILAMENT_RUNOUT_DISTANCE
float getFilamentRunoutDistance_mm(); float getFilamentRunoutDistance_mm();

3
Marlin/src/libs/buzzer.cpp

@ -66,7 +66,8 @@ void Buzzer::tick() {
CRITICAL_SECTION_START(); CRITICAL_SECTION_START();
ExtUI::onPlayTone(state.tone.frequency, state.tone.duration); ExtUI::onPlayTone(state.tone.frequency, state.tone.duration);
CRITICAL_SECTION_END(); CRITICAL_SECTION_END();
#elif ENABLED(SPEAKER) #endif
#if ENABLED(SPEAKER) && (DISABLED(EXTENSIBLE_UI) || ENABLED(EXTUI_LOCAL_BEEPER))
CRITICAL_SECTION_START(); CRITICAL_SECTION_START();
::tone(BEEPER_PIN, state.tone.frequency, state.tone.duration); ::tone(BEEPER_PIN, state.tone.frequency, state.tone.duration);
CRITICAL_SECTION_END(); CRITICAL_SECTION_END();

Loading…
Cancel
Save