|
@@ -26,19 +26,21 @@
|
26
|
26
|
#include "../feature/leds/leds.h"
|
27
|
27
|
#endif
|
28
|
28
|
|
|
29
|
+#if ENABLED(HOST_ACTION_COMMANDS)
|
|
30
|
+ #include "../feature/host_actions.h"
|
|
31
|
+#endif
|
|
32
|
+
|
|
33
|
+#include "ultralcd.h"
|
|
34
|
+MarlinUI ui;
|
|
35
|
+
|
29
|
36
|
// All displays share the MarlinUI class
|
30
|
37
|
#if HAS_DISPLAY
|
31
|
38
|
#include "../gcode/queue.h"
|
32
|
|
- #include "ultralcd.h"
|
33
|
39
|
#include "fontutils.h"
|
34
|
|
- MarlinUI ui;
|
35
|
40
|
#include "../sd/cardreader.h"
|
36
|
41
|
#if ENABLED(EXTENSIBLE_UI)
|
37
|
42
|
#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u)
|
38
|
43
|
#endif
|
39
|
|
- #if ENABLED(HOST_ACTION_COMMANDS)
|
40
|
|
- #include "../feature/host_actions.h"
|
41
|
|
- #endif
|
42
|
44
|
#endif
|
43
|
45
|
|
44
|
46
|
#if HAS_SPI_LCD
|
|
@@ -1369,6 +1371,10 @@ void MarlinUI::update() {
|
1369
|
1371
|
void MarlinUI::set_status(const char * const message, const bool persist) {
|
1370
|
1372
|
if (alert_level) return;
|
1371
|
1373
|
|
|
1374
|
+ #if ENABLED(HOST_PROMPT_SUPPORT)
|
|
1375
|
+ host_action_notify(message);
|
|
1376
|
+ #endif
|
|
1377
|
+
|
1372
|
1378
|
// Here we have a problem. The message is encoded in UTF8, so
|
1373
|
1379
|
// arbitrarily cutting it will be a problem. We MUST be sure
|
1374
|
1380
|
// that there is no cutting in the middle of a multibyte character!
|
|
@@ -1408,6 +1414,10 @@ void MarlinUI::update() {
|
1408
|
1414
|
if (level < alert_level) return;
|
1409
|
1415
|
alert_level = level;
|
1410
|
1416
|
|
|
1417
|
+ #if ENABLED(HOST_PROMPT_SUPPORT)
|
|
1418
|
+ host_action_notify(message);
|
|
1419
|
+ #endif
|
|
1420
|
+
|
1411
|
1421
|
// Since the message is encoded in UTF8 it must
|
1412
|
1422
|
// only be cut on a character boundary.
|
1413
|
1423
|
|
|
@@ -1568,4 +1578,34 @@ void MarlinUI::update() {
|
1568
|
1578
|
|
1569
|
1579
|
#endif
|
1570
|
1580
|
|
1571
|
|
-#endif // HAS_DISPLAY
|
|
1581
|
+#else // !HAS_DISPLAY
|
|
1582
|
+
|
|
1583
|
+ //
|
|
1584
|
+ // Send the status line as a host notification
|
|
1585
|
+ //
|
|
1586
|
+
|
|
1587
|
+ void MarlinUI::set_status(const char * const message, const bool) {
|
|
1588
|
+ #if ENABLED(HOST_PROMPT_SUPPORT)
|
|
1589
|
+ host_action_notify(message);
|
|
1590
|
+ #else
|
|
1591
|
+ UNUSED(message);
|
|
1592
|
+ #endif
|
|
1593
|
+ }
|
|
1594
|
+
|
|
1595
|
+ void MarlinUI::set_status_P(PGM_P message, const int8_t) {
|
|
1596
|
+ #if ENABLED(HOST_PROMPT_SUPPORT)
|
|
1597
|
+ host_action_notify(message);
|
|
1598
|
+ #else
|
|
1599
|
+ UNUSED(message);
|
|
1600
|
+ #endif
|
|
1601
|
+ }
|
|
1602
|
+
|
|
1603
|
+ void MarlinUI::status_printf_P(const uint8_t, PGM_P const message, ...) {
|
|
1604
|
+ #if ENABLED(HOST_PROMPT_SUPPORT)
|
|
1605
|
+ host_action_notify(message);
|
|
1606
|
+ #else
|
|
1607
|
+ UNUSED(message);
|
|
1608
|
+ #endif
|
|
1609
|
+ }
|
|
1610
|
+
|
|
1611
|
+#endif // !HAS_DISPLAY
|