|
|
@ -26,19 +26,21 @@ |
|
|
|
#include "../feature/leds/leds.h" |
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLED(HOST_ACTION_COMMANDS) |
|
|
|
#include "../feature/host_actions.h" |
|
|
|
#endif |
|
|
|
|
|
|
|
#include "ultralcd.h" |
|
|
|
MarlinUI ui; |
|
|
|
|
|
|
|
// All displays share the MarlinUI class
|
|
|
|
#if HAS_DISPLAY |
|
|
|
#include "../gcode/queue.h" |
|
|
|
#include "ultralcd.h" |
|
|
|
#include "fontutils.h" |
|
|
|
MarlinUI ui; |
|
|
|
#include "../sd/cardreader.h" |
|
|
|
#if ENABLED(EXTENSIBLE_UI) |
|
|
|
#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) |
|
|
|
#endif |
|
|
|
#if ENABLED(HOST_ACTION_COMMANDS) |
|
|
|
#include "../feature/host_actions.h" |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_SPI_LCD |
|
|
@ -1369,6 +1371,10 @@ void MarlinUI::update() { |
|
|
|
void MarlinUI::set_status(const char * const message, const bool persist) { |
|
|
|
if (alert_level) return; |
|
|
|
|
|
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
|
host_action_notify(message); |
|
|
|
#endif |
|
|
|
|
|
|
|
// Here we have a problem. The message is encoded in UTF8, so
|
|
|
|
// arbitrarily cutting it will be a problem. We MUST be sure
|
|
|
|
// that there is no cutting in the middle of a multibyte character!
|
|
|
@ -1408,6 +1414,10 @@ void MarlinUI::update() { |
|
|
|
if (level < alert_level) return; |
|
|
|
alert_level = level; |
|
|
|
|
|
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
|
host_action_notify(message); |
|
|
|
#endif |
|
|
|
|
|
|
|
// Since the message is encoded in UTF8 it must
|
|
|
|
// only be cut on a character boundary.
|
|
|
|
|
|
|
@ -1568,4 +1578,34 @@ void MarlinUI::update() { |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // HAS_DISPLAY
|
|
|
|
#else // !HAS_DISPLAY
|
|
|
|
|
|
|
|
//
|
|
|
|
// Send the status line as a host notification
|
|
|
|
//
|
|
|
|
|
|
|
|
void MarlinUI::set_status(const char * const message, const bool) { |
|
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
|
host_action_notify(message); |
|
|
|
#else |
|
|
|
UNUSED(message); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
void MarlinUI::set_status_P(PGM_P message, const int8_t) { |
|
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
|
host_action_notify(message); |
|
|
|
#else |
|
|
|
UNUSED(message); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
void MarlinUI::status_printf_P(const uint8_t, PGM_P const message, ...) { |
|
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
|
host_action_notify(message); |
|
|
|
#else |
|
|
|
UNUSED(message); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
#endif // !HAS_DISPLAY
|
|
|
|