Skip to content

Commit

Permalink
ExtUI additions (MarlinFirmware#18447)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <[email protected]>
  • Loading branch information
2 people authored and HairingX committed Jun 16, 2021
1 parent 049a65a commit 681bc31
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -2121,6 +2121,10 @@
//
//#define EXTENSIBLE_UI

#if ENABLED(EXTENSIBLE_UI)
//#define EXTUI_LOCAL_BEEPER // Enables use of local Beeper pin with external display
#endif

//=============================================================================
//=============================== Graphical TFTs ==============================
//=============================================================================
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/lcd/extui/ui_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,8 @@ namespace ExtUI {
#if HAS_FILAMENT_SENSOR
bool getFilamentRunoutEnabled() { return runout.enabled; }
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
float getFilamentRunoutDistance_mm() { return runout.runout_distance(); }
Expand Down Expand Up @@ -884,6 +886,7 @@ namespace ExtUI {
#endif

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()); }

Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/lcd/extui/ui_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ namespace ExtUI {
bool canMove(const axis_t);
bool canMove(const extruder_t);
void injectCommands_P(PGM_P const);
void injectCommands(char * const);
bool commandsInQueue();

bool isHeaterIdle(const heater_t);
Expand Down Expand Up @@ -236,6 +237,8 @@ namespace ExtUI {
#if HAS_FILAMENT_SENSOR
bool getFilamentRunoutEnabled();
void setFilamentRunoutEnabled(const bool);
bool getFilamentRunoutState();
void setFilamentRunoutState(const bool);

#if HAS_FILAMENT_RUNOUT_DISTANCE
float getFilamentRunoutDistance_mm();
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/libs/buzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ void Buzzer::tick() {
CRITICAL_SECTION_START();
ExtUI::onPlayTone(state.tone.frequency, state.tone.duration);
CRITICAL_SECTION_END();
#elif ENABLED(SPEAKER)
#endif
#if ENABLED(SPEAKER) && (DISABLED(EXTENSIBLE_UI) || ENABLED(EXTUI_LOCAL_BEEPER))
CRITICAL_SECTION_START();
::tone(BEEPER_PIN, state.tone.frequency, state.tone.duration);
CRITICAL_SECTION_END();
Expand Down

0 comments on commit 681bc31

Please sign in to comment.