Skip to content

Commit

Permalink
Allow Status Message without LCD (MarlinFirmware#20246)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and zillarob committed Feb 25, 2021
1 parent ebcda2b commit 9b8f5e0
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions Marlin/src/lcd/ultralcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,24 +359,38 @@ class MarlinUI {
static constexpr uint8_t get_progress_percent() { return 0; }
#endif

#if HAS_DISPLAY

static void init();
static void update();
static void set_alert_status_P(PGM_P const message);

#if HAS_STATUS_MESSAGE
static char status_message[];
static bool has_status();

static uint8_t alert_level; // Higher levels block lower levels
static inline void reset_alert_level() { alert_level = 0; }

#if ENABLED(STATUS_MESSAGE_SCROLLING)
static uint8_t status_scroll_offset;
static void advance_status_scroll();
static char* status_and_len(uint8_t &len);
#endif

static bool has_status();
static void reset_status(const bool no_welcome=false);
static void set_status(const char* const message, const bool persist=false);
static void set_status_P(PGM_P const message, const int8_t level=0);
static void status_printf_P(const uint8_t level, PGM_P const fmt, ...);
static void set_alert_status_P(PGM_P const message);
static inline void reset_alert_level() { alert_level = 0; }
#else
static constexpr bool has_status() { return false; }
static inline void reset_status(const bool=false) {}
static void set_status(const char* message, const bool=false);
static void set_status_P(PGM_P message, const int8_t=0);
static void status_printf_P(const uint8_t, PGM_P message, ...);
static inline void set_alert_status_P(PGM_P const) {}
static inline void reset_alert_level() {}
#endif

#if HAS_DISPLAY

static void init();
static void update();

static void abort_print();
static void pause_print();
static void resume_print();
Expand Down Expand Up @@ -467,25 +481,12 @@ class MarlinUI {
static bool get_blink();
static void kill_screen(PGM_P const lcd_error, PGM_P const lcd_component);
static void draw_kill_screen();
static void set_status(const char* const message, const bool persist=false);
static void set_status_P(PGM_P const message, const int8_t level=0);
static void status_printf_P(const uint8_t level, PGM_P const fmt, ...);
static void reset_status(const bool no_welcome=false);

#else // No LCD

// Send status to host as a notification
static void set_status(const char* message, const bool=false);
static void set_status_P(PGM_P message, const int8_t=0);
static void status_printf_P(const uint8_t, PGM_P message, ...);

static inline void init() {}
static inline void update() {}
static inline void return_to_status() {}
static inline void set_alert_status_P(PGM_P const) {}
static inline void reset_status(const bool=false) {}
static inline void reset_alert_level() {}
static constexpr bool has_status() { return false; }

#endif

Expand Down Expand Up @@ -688,7 +689,7 @@ class MarlinUI {

private:

#if HAS_DISPLAY
#if HAS_STATUS_MESSAGE
static void finish_status(const bool persist);
#endif

Expand Down

0 comments on commit 9b8f5e0

Please sign in to comment.