Преглед изворни кода

🎨 Refactor Host Actions as singleton

Scott Lahteine пре 2 година
родитељ
комит
ee28a14e8e

+ 2
- 2
Marlin/src/MarlinCore.cpp Прегледај датотеку

@@ -872,7 +872,7 @@ void kill(FSTR_P const lcd_error/*=nullptr*/, FSTR_P const lcd_component/*=nullp
872 872
   SERIAL_ERROR_MSG(STR_ERR_KILLED);
873 873
 
874 874
   #ifdef ACTION_ON_KILL
875
-    host_action_kill();
875
+    hostui.kill();
876 876
   #endif
877 877
 
878 878
   minkill(steppers_off);
@@ -1525,7 +1525,7 @@ void setup() {
1525 1525
   #endif
1526 1526
 
1527 1527
   #if ENABLED(HOST_PROMPT_SUPPORT)
1528
-    SETUP_RUN(host_action_prompt_end());
1528
+    SETUP_RUN(hostui.prompt_end());
1529 1529
   #endif
1530 1530
 
1531 1531
   #if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF)

+ 1
- 1
Marlin/src/feature/e_parser.h Прегледај датотеку

@@ -199,7 +199,7 @@ public:
199 199
             case EP_M112: killed_by_M112 = true; break;
200 200
             case EP_M410: quickstop_by_M410 = true; break;
201 201
             #if ENABLED(HOST_PROMPT_SUPPORT)
202
-              case EP_M876SN: host_response_handler(M876_reason); break;
202
+              case EP_M876SN: hostui.handle_response(M876_reason); break;
203 203
             #endif
204 204
             #if ENABLED(REALTIME_REPORTING_COMMANDS)
205 205
               case EP_GRBL_STATUS: report_current_position_moving(); break;

+ 66
- 45
Marlin/src/feature/host_actions.cpp Прегледај датотеку

@@ -24,10 +24,10 @@
24 24
 
25 25
 #if ENABLED(HOST_ACTION_COMMANDS)
26 26
 
27
-#include "host_actions.h"
28
-
29 27
 //#define DEBUG_HOST_ACTIONS
30 28
 
29
+#include "host_actions.h"
30
+
31 31
 #if ENABLED(ADVANCED_PAUSE_FEATURE)
32 32
   #include "pause.h"
33 33
   #include "../gcode/queue.h"
@@ -37,7 +37,12 @@
37 37
   #include "runout.h"
38 38
 #endif
39 39
 
40
-void host_action(FSTR_P const fstr, const bool eol) {
40
+HostUI hostui;
41
+
42
+flag_t HostUI::flag;
43
+
44
+void HostUI::action(FSTR_P const fstr, const bool eol) {
45
+  if (!flag.bits) return;
41 46
   PORT_REDIRECT(SerialMask::All);
42 47
   SERIAL_ECHOPGM("//action:");
43 48
   SERIAL_ECHOF(fstr);
@@ -45,29 +50,40 @@ void host_action(FSTR_P const fstr, const bool eol) {
45 50
 }
46 51
 
47 52
 #ifdef ACTION_ON_KILL
48
-  void host_action_kill() { host_action(F(ACTION_ON_KILL)); }
53
+  void HostUI::kill() { action(F(ACTION_ON_KILL)); }
49 54
 #endif
50 55
 #ifdef ACTION_ON_PAUSE
51
-  void host_action_pause(const bool eol/*=true*/) { host_action(F(ACTION_ON_PAUSE), eol); }
56
+  void HostUI::pause(const bool eol/*=true*/) { action(F(ACTION_ON_PAUSE), eol); }
52 57
 #endif
53 58
 #ifdef ACTION_ON_PAUSED
54
-  void host_action_paused(const bool eol/*=true*/) { host_action(F(ACTION_ON_PAUSED), eol); }
59
+  void HostUI::paused(const bool eol/*=true*/) { action(F(ACTION_ON_PAUSED), eol); }
55 60
 #endif
56 61
 #ifdef ACTION_ON_RESUME
57
-  void host_action_resume() { host_action(F(ACTION_ON_RESUME)); }
62
+  void HostUI::resume() { action(F(ACTION_ON_RESUME)); }
58 63
 #endif
59 64
 #ifdef ACTION_ON_RESUMED
60
-  void host_action_resumed() { host_action(F(ACTION_ON_RESUMED)); }
65
+  void HostUI::resumed() { action(F(ACTION_ON_RESUMED)); }
61 66
 #endif
62 67
 #ifdef ACTION_ON_CANCEL
63
-  void host_action_cancel() { host_action(F(ACTION_ON_CANCEL)); }
68
+  void HostUI::cancel() { action(F(ACTION_ON_CANCEL)); }
64 69
 #endif
65 70
 #ifdef ACTION_ON_START
66
-  void host_action_start() { host_action(F(ACTION_ON_START)); }
71
+  void HostUI::start() { action(F(ACTION_ON_START)); }
72
+#endif
73
+
74
+#if ENABLED(G29_RETRY_AND_RECOVER)
75
+  #ifdef ACTION_ON_G29_RECOVER
76
+    void HostUI::g29_recover() { action(F(ACTION_ON_G29_RECOVER)); }
77
+  #endif
78
+  #ifdef ACTION_ON_G29_FAILURE
79
+    void HostUI::g29_failure() { action(F(ACTION_ON_G29_FAILURE)); }
80
+  #endif
67 81
 #endif
68 82
 
69 83
 #if ENABLED(HOST_PROMPT_SUPPORT)
70 84
 
85
+  PromptReason HostUI::host_prompt_reason = PROMPT_NOT_DEFINED;
86
+
71 87
   PGMSTR(CONTINUE_STR, "Continue");
72 88
   PGMSTR(DISMISS_STR, "Dismiss");
73 89
 
@@ -75,64 +91,69 @@ void host_action(FSTR_P const fstr, const bool eol) {
75 91
     extern bool wait_for_user;
76 92
   #endif
77 93
 
78
-  PromptReason host_prompt_reason = PROMPT_NOT_DEFINED;
79
-
80
-  void host_action_notify(const char * const cstr) {
94
+  void HostUI::notify(const char * const cstr) {
95
+    if (!flag.bits) return;
81 96
     PORT_REDIRECT(SerialMask::All);
82
-    host_action(F("notification "), false);
97
+    action(F("notification "), false);
83 98
     SERIAL_ECHOLN(cstr);
84 99
   }
85 100
 
86
-  void host_action_notify(FSTR_P const fstr) {
101
+  void HostUI::notify_P(PGM_P const pstr) {
102
+    if (!flag.bits) return;
87 103
     PORT_REDIRECT(SerialMask::All);
88
-    host_action(F("notification "), false);
89
-    SERIAL_ECHOLNF(fstr);
104
+    action(F("notification "), false);
105
+    SERIAL_ECHOLNPGM_P(pstr);
90 106
   }
91 107
 
92
-  void host_action_prompt(FSTR_P const ptype, const bool eol=true) {
108
+  void HostUI::prompt(FSTR_P const ptype, const bool eol/*=true*/) {
109
+    if (!flag.bits) return;
93 110
     PORT_REDIRECT(SerialMask::All);
94
-    host_action(F("prompt_"), false);
111
+    action(F("prompt_"), false);
95 112
     SERIAL_ECHOF(ptype);
96 113
     if (eol) SERIAL_EOL();
97 114
   }
98 115
 
99
-  void host_action_prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char='\0') {
100
-    host_action_prompt(ptype, false);
116
+  void HostUI::prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char/*='\0'*/) {
117
+    if (!flag.bits) return;
118
+    prompt(ptype, false);
101 119
     PORT_REDIRECT(SerialMask::All);
102 120
     SERIAL_CHAR(' ');
103 121
     SERIAL_ECHOF(fstr);
104 122
     if (extra_char != '\0') SERIAL_CHAR(extra_char);
105 123
     SERIAL_EOL();
106 124
   }
107
-  void host_action_prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) {
108
-    host_action_prompt_end();
125
+  void HostUI::prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) {
126
+    if (!flag.bits) return;
127
+    prompt_end();
109 128
     host_prompt_reason = reason;
110
-    host_action_prompt_plus(F("begin"), fstr, extra_char);
129
+    prompt_plus(F("begin"), fstr, extra_char);
111 130
   }
112
-  void host_action_prompt_button(FSTR_P const fstr) { host_action_prompt_plus(F("button"), fstr); }
113
-  void host_action_prompt_end() { host_action_prompt(F("end")); }
114
-  void host_action_prompt_show() { host_action_prompt(F("show")); }
115
-
116
-  void _host_prompt_show(FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
117
-    if (btn1) host_action_prompt_button(btn1);
118
-    if (btn2) host_action_prompt_button(btn2);
119
-    host_action_prompt_show();
131
+  void HostUI::prompt_button(FSTR_P const fstr) { prompt_plus(F("button"), fstr); }
132
+  void HostUI::prompt_end() { prompt(F("end")); }
133
+  void HostUI::prompt_show() { prompt(F("show")); }
134
+
135
+  void HostUI::_prompt_show(FSTR_P const btn1, FSTR_P const btn2) {
136
+    if (btn1) prompt_button(btn1);
137
+    if (btn2) prompt_button(btn2);
138
+    prompt_show();
120 139
   }
121
-  void host_prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
122
-    host_action_prompt_begin(reason, fstr);
123
-    _host_prompt_show(btn1, btn2);
140
+  void HostUI::prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
141
+    prompt_begin(reason, fstr);
142
+    _prompt_show(btn1, btn2);
124 143
   }
125
-  void host_prompt_do(const PromptReason reason, FSTR_P const fstr, const char extra_char, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
126
-    host_action_prompt_begin(reason, fstr, extra_char);
127
-    _host_prompt_show(btn1, btn2);
144
+  void HostUI::prompt_do(const PromptReason reason, FSTR_P const fstr, const char extra_char, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
145
+    prompt_begin(reason, fstr, extra_char);
146
+    _prompt_show(btn1, btn2);
128 147
   }
129 148
 
130
-  void filament_load_host_prompt() {
131
-    const bool disable_to_continue = TERN0(HAS_FILAMENT_SENSOR, runout.filament_ran_out);
132
-    host_prompt_do(PROMPT_FILAMENT_RUNOUT, F("Paused"), F("PurgeMore"),
133
-      disable_to_continue ? F("DisableRunout") : FPSTR(CONTINUE_STR)
134
-    );
135
-  }
149
+  #if ENABLED(ADVANCED_PAUSE_FEATURE)
150
+    void HostUI::filament_load_prompt() {
151
+      const bool disable_to_continue = TERN0(HAS_FILAMENT_SENSOR, runout.filament_ran_out);
152
+      prompt_do(PROMPT_FILAMENT_RUNOUT, F("Paused"), F("PurgeMore"),
153
+        disable_to_continue ? F("DisableRunout") : FPSTR(CONTINUE_STR)
154
+      );
155
+    }
156
+  #endif
136 157
 
137 158
   //
138 159
   // Handle responses from the host, such as:
@@ -141,7 +162,7 @@ void host_action(FSTR_P const fstr, const bool eol) {
141 162
   //  - Resume Print response
142 163
   //  - Dismissal of info
143 164
   //
144
-  void host_response_handler(const uint8_t response) {
165
+  void HostUI::handle_response(const uint8_t response) {
145 166
     const PromptReason hpr = host_prompt_reason;
146 167
     host_prompt_reason = PROMPT_NOT_DEFINED;  // Reset now ahead of logic
147 168
     switch (hpr) {

+ 78
- 40
Marlin/src/feature/host_actions.h Прегледај датотеку

@@ -24,34 +24,13 @@
24 24
 #include "../inc/MarlinConfigPre.h"
25 25
 #include "../HAL/shared/Marduino.h"
26 26
 
27
-void host_action(FSTR_P const fstr, const bool eol=true);
28
-
29
-#ifdef ACTION_ON_KILL
30
-  void host_action_kill();
31
-#endif
32
-#ifdef ACTION_ON_PAUSE
33
-  void host_action_pause(const bool eol=true);
34
-#endif
35
-#ifdef ACTION_ON_PAUSED
36
-  void host_action_paused(const bool eol=true);
37
-#endif
38
-#ifdef ACTION_ON_RESUME
39
-  void host_action_resume();
40
-#endif
41
-#ifdef ACTION_ON_RESUMED
42
-  void host_action_resumed();
43
-#endif
44
-#ifdef ACTION_ON_CANCEL
45
-  void host_action_cancel();
46
-#endif
47
-#ifdef ACTION_ON_START
48
-  void host_action_start();
49
-#endif
27
+typedef union {
28
+  uint8_t bits;
29
+  struct { bool info:1, errors:1, debug:1; };
30
+} flag_t;
50 31
 
51 32
 #if ENABLED(HOST_PROMPT_SUPPORT)
52 33
 
53
-  extern const char CONTINUE_STR[], DISMISS_STR[];
54
-
55 34
   enum PromptReason : uint8_t {
56 35
     PROMPT_NOT_DEFINED,
57 36
     PROMPT_FILAMENT_RUNOUT,
@@ -61,21 +40,80 @@ void host_action(FSTR_P const fstr, const bool eol=true);
61 40
     PROMPT_INFO
62 41
   };
63 42
 
64
-  extern PromptReason host_prompt_reason;
43
+#endif
65 44
 
66
-  void host_response_handler(const uint8_t response);
67
-  void host_action_notify(const char * const cstr);
68
-  void host_action_notify(FSTR_P const fstr);
69
-  void host_action_prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0');
70
-  void host_action_prompt_button(FSTR_P const fstr);
71
-  void host_action_prompt_end();
72
-  void host_action_prompt_show();
73
-  void host_prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
74
-  void host_prompt_do(const PromptReason reason, FSTR_P const fstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
75
-  inline void host_prompt_open(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) {
76
-    if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, fstr, btn1, btn2);
77
-  }
45
+class HostUI {
46
+  public:
78 47
 
79
-  void filament_load_host_prompt();
48
+  static flag_t flag;
49
+  HostUI() { flag.bits = 0xFF; }
80 50
 
81
-#endif
51
+  static void action(FSTR_P const fstr, const bool eol=true);
52
+
53
+  #ifdef ACTION_ON_KILL
54
+    static void kill();
55
+  #endif
56
+  #ifdef ACTION_ON_PAUSE
57
+    static void pause(const bool eol=true);
58
+  #endif
59
+  #ifdef ACTION_ON_PAUSED
60
+    static void paused(const bool eol=true);
61
+  #endif
62
+  #ifdef ACTION_ON_RESUME
63
+    static void resume();
64
+  #endif
65
+  #ifdef ACTION_ON_RESUMED
66
+    static void resumed();
67
+  #endif
68
+  #ifdef ACTION_ON_CANCEL
69
+    static void cancel();
70
+  #endif
71
+  #ifdef ACTION_ON_START
72
+    static void start();
73
+  #endif
74
+
75
+  #if ENABLED(G29_RETRY_AND_RECOVER)
76
+    #ifdef ACTION_ON_G29_RECOVER
77
+      static void g29_recover();
78
+    #endif
79
+    #ifdef ACTION_ON_G29_FAILURE
80
+      static void g29_failure();
81
+    #endif
82
+  #endif
83
+
84
+  #if ENABLED(HOST_PROMPT_SUPPORT)
85
+    private:
86
+    static void prompt(FSTR_P const ptype, const bool eol=true);
87
+    static void prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char='\0');
88
+    static void prompt_show();
89
+    static void _prompt_show(FSTR_P const btn1, FSTR_P const btn2);
90
+
91
+    public:
92
+    static PromptReason host_prompt_reason;
93
+
94
+    static void handle_response(const uint8_t response);
95
+
96
+    static void notify_P(PGM_P const message);
97
+    static inline void notify(FSTR_P const fmsg) { notify_P(FTOP(fmsg)); }
98
+    static void notify(const char * const message);
99
+
100
+    static void prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0');
101
+    static void prompt_button(FSTR_P const fstr);
102
+    static void prompt_end();
103
+    static void prompt_do(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
104
+    static void prompt_do(const PromptReason reason, FSTR_P const pstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
105
+    static inline void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) {
106
+      if (host_prompt_reason == PROMPT_NOT_DEFINED) prompt_do(reason, pstr, btn1, btn2);
107
+    }
108
+
109
+    #if ENABLED(ADVANCED_PAUSE_FEATURE)
110
+      static void filament_load_prompt();
111
+    #endif
112
+
113
+  #endif
114
+
115
+};
116
+
117
+extern HostUI hostui;
118
+
119
+extern const char CONTINUE_STR[], DISMISS_STR[];

+ 1
- 1
Marlin/src/feature/mmu/mmu2.cpp Прегледај датотеку

@@ -962,7 +962,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
962 962
   if (recover)  {
963 963
     LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
964 964
     BUZZ(200, 404);
965
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR)));
965
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR)));
966 966
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("MMU2 Eject Recover")));
967 967
     TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
968 968
     BUZZ(200, 404);

+ 14
- 14
Marlin/src/feature/pause.cpp Прегледај датотеку

@@ -198,7 +198,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
198 198
 
199 199
     #if ENABLED(HOST_PROMPT_SUPPORT)
200 200
       const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, active_extruder);
201
-      host_prompt_do(PROMPT_USER_CONTINUE, F("Load Filament T"), tool, FPSTR(CONTINUE_STR));
201
+      hostui.prompt_do(PROMPT_USER_CONTINUE, F("Load Filament T"), tool, FPSTR(CONTINUE_STR));
202 202
     #endif
203 203
 
204 204
     while (wait_for_user) {
@@ -253,7 +253,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
253 253
     if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE);
254 254
 
255 255
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)));
256
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
256
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
257 257
     TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
258 258
     wait_for_user = true; // A click or M108 breaks the purge_length loop
259 259
     for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
@@ -271,7 +271,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
271 271
         unscaled_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
272 272
       }
273 273
 
274
-      TERN_(HOST_PROMPT_SUPPORT, filament_load_host_prompt()); // Initiate another host prompt.
274
+      TERN_(HOST_PROMPT_SUPPORT, hostui.filament_load_prompt()); // Initiate another host prompt.
275 275
 
276 276
       #if M600_PURGE_MORE_RESUMABLE
277 277
         if (show_lcd) {
@@ -291,7 +291,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
291 291
     } while (TERN0(M600_PURGE_MORE_RESUMABLE, pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE));
292 292
 
293 293
   #endif
294
-  TERN_(HOST_PROMPT_SUPPORT, host_action_prompt_end());
294
+  TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_end());
295 295
 
296 296
   return true;
297 297
 }
@@ -397,13 +397,13 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
397 397
 
398 398
   #if ENABLED(HOST_ACTION_COMMANDS)
399 399
     #ifdef ACTION_ON_PAUSED
400
-      host_action_paused();
400
+      hostui.paused();
401 401
     #elif defined(ACTION_ON_PAUSE)
402
-      host_action_pause();
402
+      hostui.pause();
403 403
     #endif
404 404
   #endif
405 405
 
406
-  TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("Pause"), FPSTR(DISMISS_STR)));
406
+  TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Pause"), FPSTR(DISMISS_STR)));
407 407
 
408 408
   // Indicate that the printer is paused
409 409
   ++did_pause_print;
@@ -512,7 +512,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
512 512
 
513 513
   // Wait for filament insert by user and press button
514 514
   KEEPALIVE_STATE(PAUSED_FOR_USER);
515
-  TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_NOZZLE_PARKED), FPSTR(CONTINUE_STR)));
515
+  TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_NOZZLE_PARKED), FPSTR(CONTINUE_STR)));
516 516
   TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_NOZZLE_PARKED)));
517 517
   wait_for_user = true;    // LCD click or M108 will clear this
518 518
   while (wait_for_user) {
@@ -528,13 +528,13 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
528 528
       ui.pause_show_message(PAUSE_MESSAGE_HEAT);
529 529
       SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_HEAT));
530 530
 
531
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_HEATER_TIMEOUT), GET_TEXT_F(MSG_REHEAT)));
531
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_HEATER_TIMEOUT), GET_TEXT_F(MSG_REHEAT)));
532 532
 
533 533
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_HEATER_TIMEOUT)));
534 534
 
535 535
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(0, true)); // Wait for LCD click or M108
536 536
 
537
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, GET_TEXT_F(MSG_REHEATING)));
537
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_INFO, GET_TEXT_F(MSG_REHEATING)));
538 538
 
539 539
       TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(GET_TEXT_F(MSG_REHEATING)));
540 540
 
@@ -554,7 +554,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
554 554
 
555 555
       HOTEND_LOOP() thermalManager.heater_idle[e].start(nozzle_timeout);
556 556
 
557
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_REHEATDONE), FPSTR(CONTINUE_STR)));
557
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_REHEATDONE), FPSTR(CONTINUE_STR)));
558 558
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_REHEATDONE)));
559 559
       TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_REHEATDONE));
560 560
 
@@ -664,14 +664,14 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
664 664
   ui.pause_show_message(PAUSE_MESSAGE_STATUS);
665 665
 
666 666
   #ifdef ACTION_ON_RESUMED
667
-    host_action_resumed();
667
+    hostui.resumed();
668 668
   #elif defined(ACTION_ON_RESUME)
669
-    host_action_resume();
669
+    hostui.resume();
670 670
   #endif
671 671
 
672 672
   --did_pause_print;
673 673
 
674
-  TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("Resuming"), FPSTR(DISMISS_STR)));
674
+  TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Resuming"), FPSTR(DISMISS_STR)));
675 675
 
676 676
   // Resume the print job timer if it was running
677 677
   if (print_job_timer.isPaused()) print_job_timer.start();

+ 4
- 5
Marlin/src/feature/runout.cpp Прегледај датотеку

@@ -96,8 +96,7 @@ void event_filament_runout(const uint8_t extruder) {
96 96
 
97 97
   //action:out_of_filament
98 98
   #if ENABLED(HOST_PROMPT_SUPPORT)
99
-    host_action_prompt_begin(PROMPT_FILAMENT_RUNOUT, F("FilamentRunout T"), tool);
100
-    host_action_prompt_show();
99
+    hostui.prompt_do(PROMPT_FILAMENT_RUNOUT, F("FilamentRunout T"), tool); //action:out_of_filament
101 100
   #endif
102 101
 
103 102
   const bool run_runout_script = !runout.host_handling;
@@ -109,18 +108,18 @@ void event_filament_runout(const uint8_t extruder) {
109 108
         || TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25"))
110 109
       )
111 110
     ) {
112
-      host_action_paused(false);
111
+      hostui.paused(false);
113 112
     }
114 113
     else {
115 114
       // Legacy Repetier command for use until newer version supports standard dialog
116 115
       // To be removed later when pause command also triggers dialog
117 116
       #ifdef ACTION_ON_FILAMENT_RUNOUT
118
-        host_action(F(ACTION_ON_FILAMENT_RUNOUT " T"), false);
117
+        hostui.action(F(ACTION_ON_FILAMENT_RUNOUT " T"), false);
119 118
         SERIAL_CHAR(tool);
120 119
         SERIAL_EOL();
121 120
       #endif
122 121
 
123
-      host_action_pause(false);
122
+      hostui.pause(false);
124 123
     }
125 124
     SERIAL_ECHOPGM(" " ACTION_REASON_ON_FILAMENT_RUNOUT " ");
126 125
     SERIAL_CHAR(tool);

+ 1
- 1
Marlin/src/gcode/config/M43.cpp Прегледај датотеку

@@ -344,7 +344,7 @@ void GcodeSuite::M43() {
344 344
     #if HAS_RESUME_CONTINUE
345 345
       KEEPALIVE_STATE(PAUSED_FOR_USER);
346 346
       wait_for_user = true;
347
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("M43 Wait Called"), FPSTR(CONTINUE_STR)));
347
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("M43 Wait Called"), FPSTR(CONTINUE_STR)));
348 348
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("M43 Wait Called")));
349 349
     #endif
350 350
 

+ 1
- 1
Marlin/src/gcode/control/M111.cpp Прегледај датотеку

@@ -26,7 +26,7 @@
26 26
  * M111: Set the debug level
27 27
  */
28 28
 void GcodeSuite::M111() {
29
-  if (parser.seen('S')) marlin_debug_flags = parser.byteval('S');
29
+  if (parser.seenval('S')) marlin_debug_flags = parser.value_byte();
30 30
 
31 31
   static PGMSTR(str_debug_1, STR_DEBUG_ECHO);
32 32
   static PGMSTR(str_debug_2, STR_DEBUG_INFO);

+ 5
- 5
Marlin/src/gcode/gcode.cpp Прегледај датотеку

@@ -237,9 +237,9 @@ void GcodeSuite::dwell(millis_t time) {
237 237
 #if ENABLED(G29_RETRY_AND_RECOVER)
238 238
 
239 239
   void GcodeSuite::event_probe_recover() {
240
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, F("G29 Retrying"), FPSTR(DISMISS_STR)));
240
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_INFO, F("G29 Retrying"), FPSTR(DISMISS_STR)));
241 241
     #ifdef ACTION_ON_G29_RECOVER
242
-      host_action(F(ACTION_ON_G29_RECOVER));
242
+      hostui.g29_recover();
243 243
     #endif
244 244
     #ifdef G29_RECOVER_COMMANDS
245 245
       process_subcommands_now(F(G29_RECOVER_COMMANDS));
@@ -252,14 +252,14 @@ void GcodeSuite::dwell(millis_t time) {
252 252
 
253 253
   void GcodeSuite::event_probe_failure() {
254 254
     #ifdef ACTION_ON_G29_FAILURE
255
-      host_action(F(ACTION_ON_G29_FAILURE));
255
+      hostui.g29_failure();
256 256
     #endif
257 257
     #ifdef G29_FAILURE_COMMANDS
258 258
       process_subcommands_now(F(G29_FAILURE_COMMANDS));
259 259
     #endif
260 260
     #if ENABLED(G29_HALT_ON_FAILURE)
261 261
       #ifdef ACTION_ON_CANCEL
262
-        host_action_cancel();
262
+        hostui.cancel();
263 263
       #endif
264 264
       kill(GET_TEXT_F(MSG_LCD_PROBING_FAILED));
265 265
     #endif
@@ -282,7 +282,7 @@ void GcodeSuite::dwell(millis_t time) {
282 282
       }
283 283
     }
284 284
 
285
-    TERN_(HOST_PROMPT_SUPPORT, host_action_prompt_end());
285
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_end());
286 286
 
287 287
     #ifdef G29_SUCCESS_COMMANDS
288 288
       process_subcommands_now(F(G29_SUCCESS_COMMANDS));

+ 1
- 1
Marlin/src/gcode/host/M876.cpp Прегледај датотеку

@@ -33,7 +33,7 @@
33 33
  */
34 34
 void GcodeSuite::M876() {
35 35
 
36
-  if (parser.seenval('S')) host_response_handler((uint8_t)parser.value_int());
36
+  if (parser.seenval('S')) hostui.handle_response((uint8_t)parser.value_int());
37 37
 
38 38
 }
39 39
 

+ 1
- 1
Marlin/src/gcode/lcd/M0_M1.cpp Прегледај датотеку

@@ -84,7 +84,7 @@ void GcodeSuite::M0_M1() {
84 84
 
85 85
   #endif
86 86
 
87
-  TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR)));
87
+  TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR)));
88 88
 
89 89
   TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms));
90 90
 

+ 1
- 1
Marlin/src/gcode/sd/M1001.cpp Прегледај датотеку

@@ -97,7 +97,7 @@ void GcodeSuite::M1001() {
97 97
     if (long_print) {
98 98
       printerEventLEDs.onPrintCompleted();
99 99
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_PRINT_DONE)));
100
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_PRINT_DONE), FPSTR(CONTINUE_STR)));
100
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_PRINT_DONE), FPSTR(CONTINUE_STR)));
101 101
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(SEC_TO_MS(TERN(HAS_LCD_MENU, PE_LEDS_COMPLETED_TIME, 30))));
102 102
       printerEventLEDs.onResumeAfterWait();
103 103
     }

+ 4
- 4
Marlin/src/gcode/sd/M24_M25.cpp Прегледај датотеку

@@ -77,9 +77,9 @@ void GcodeSuite::M24() {
77 77
 
78 78
   #if ENABLED(HOST_ACTION_COMMANDS)
79 79
     #ifdef ACTION_ON_RESUME
80
-      host_action_resume();
80
+      hostui.resume();
81 81
     #endif
82
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("Resuming SD"), FPSTR(DISMISS_STR)));
82
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Resuming SD"), FPSTR(DISMISS_STR)));
83 83
   #endif
84 84
 
85 85
   ui.reset_status();
@@ -116,9 +116,9 @@ void GcodeSuite::M25() {
116 116
     IF_DISABLED(DWIN_CREALITY_LCD, ui.reset_status());
117 117
 
118 118
     #if ENABLED(HOST_ACTION_COMMANDS)
119
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, F("Pause SD"), F("Resume")));
119
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_PAUSE_RESUME, F("Pause SD"), F("Resume")));
120 120
       #ifdef ACTION_ON_PAUSE
121
-        host_action_pause();
121
+        hostui.pause();
122 122
       #endif
123 123
     #endif
124 124
 

+ 1
- 1
Marlin/src/gcode/stats/M75-M78.cpp Прегледај датотеку

@@ -49,7 +49,7 @@ void GcodeSuite::M75() {
49 49
  */
50 50
 void GcodeSuite::M76() {
51 51
   print_job_timer.pause();
52
-  TERN_(HOST_PAUSE_M76, host_action_pause());
52
+  TERN_(HOST_PAUSE_M76, hostui.pause());
53 53
 }
54 54
 
55 55
 /**

+ 1
- 1
Marlin/src/lcd/e3v2/creality/dwin.cpp Прегледај датотеку

@@ -2363,7 +2363,7 @@ void HMI_PauseOrStop() {
2363 2363
         card.abortFilePrintSoon();                     // Let the main loop handle SD abort
2364 2364
         dwin_abort_flag = true;                        // Reset feedrate, return to Home
2365 2365
         #ifdef ACTION_ON_CANCEL
2366
-          host_action_cancel();
2366
+          hostui.cancel();
2367 2367
         #endif
2368 2368
         Popup_Window_Home(true);
2369 2369
         if (HMI_flag.home_flag) planner.synchronize(); // Wait for planner moves to finish!

+ 1
- 1
Marlin/src/lcd/e3v2/enhanced/dwin.cpp Прегледај датотеку

@@ -1391,7 +1391,7 @@ void HMI_PauseOrStop() {
1391 1391
         card.abortFilePrintSoon();                     // Let the main loop handle SD abort
1392 1392
         dwin_abort_flag = true;                        // Reset feedrate, return to Home
1393 1393
         #ifdef ACTION_ON_CANCEL
1394
-          host_action_cancel();
1394
+          hostui.cancel();
1395 1395
         #endif
1396 1396
         DWIN_Draw_Popup(ICON_BLTouch, F("Stopping...") , F("Please wait until done."));
1397 1397
       }

+ 3
- 3
Marlin/src/lcd/e3v2/jyersui/dwin.cpp Прегледај датотеку

@@ -4503,7 +4503,7 @@ void CrealityDWINClass::Print_Screen_Control() {
4503 4503
             #endif
4504 4504
           }
4505 4505
           else {
4506
-            TERN_(HOST_ACTION_COMMANDS, host_action_resume());
4506
+            TERN_(HOST_ACTION_COMMANDS, hostui.resume());
4507 4507
           }
4508 4508
           Draw_Print_Screen();
4509 4509
         }
@@ -4553,7 +4553,7 @@ void CrealityDWINClass::Popup_Control() {
4553 4553
             #endif
4554 4554
           }
4555 4555
           else {
4556
-            TERN_(HOST_ACTION_COMMANDS, host_action_pause());
4556
+            TERN_(HOST_ACTION_COMMANDS, hostui.pause());
4557 4557
           }
4558 4558
         }
4559 4559
         Draw_Print_Screen();
@@ -4566,7 +4566,7 @@ void CrealityDWINClass::Popup_Control() {
4566 4566
             thermalManager.disable_all_heaters();
4567 4567
           }
4568 4568
           else {
4569
-            TERN_(HOST_ACTION_COMMANDS, host_action_cancel());
4569
+            TERN_(HOST_ACTION_COMMANDS, hostui.cancel());
4570 4570
           }
4571 4571
         }
4572 4572
         else

+ 2
- 2
Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp Прегледај датотеку

@@ -242,7 +242,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
242 242
       if (ExtUI::isPrintingFromMedia())
243 243
         ExtUI::pausePrint();
244 244
       #ifdef ACTION_ON_PAUSE
245
-        else host_action_pause();
245
+        else hostui.pause();
246 246
       #endif
247 247
       GOTO_SCREEN(StatusScreen);
248 248
       break;
@@ -251,7 +251,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
251 251
       if (ExtUI::isPrintingFromMedia())
252 252
         ExtUI::resumePrint();
253 253
       #ifdef ACTION_ON_RESUME
254
-        else host_action_resume();
254
+        else hostui.resume();
255 255
       #endif
256 256
       GOTO_SCREEN(StatusScreen);
257 257
       break;

+ 1
- 1
Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/confirm_abort_print_dialog_box.cpp Прегледај датотеку

@@ -41,7 +41,7 @@ bool ConfirmAbortPrintDialogBox::onTouchEnd(uint8_t tag) {
41 41
       if (ExtUI::isPrintingFromMedia())
42 42
          ExtUI::stopPrint();
43 43
       #ifdef ACTION_ON_CANCEL
44
-        else host_action_cancel();
44
+        else hostui.cancel();
45 45
       #endif
46 46
       return true;
47 47
     default:

+ 2
- 2
Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/tune_menu.cpp Прегледај датотеку

@@ -138,7 +138,7 @@ void TuneMenu::pausePrint() {
138 138
   if (ExtUI::isPrintingFromMedia())
139 139
     ExtUI::pausePrint();
140 140
   #ifdef ACTION_ON_PAUSE
141
-    else host_action_pause();
141
+    else hostui.pause();
142 142
   #endif
143 143
   GOTO_SCREEN(StatusScreen);
144 144
 }
@@ -150,7 +150,7 @@ void TuneMenu::resumePrint() {
150 150
   else if (ExtUI::isPrintingFromMedia())
151 151
     ExtUI::resumePrint();
152 152
   #ifdef ACTION_ON_RESUME
153
-    else host_action_resume();
153
+    else hostui.resume();
154 154
   #endif
155 155
   GOTO_SCREEN(StatusScreen);
156 156
 }

+ 1
- 1
Marlin/src/lcd/extui/ui_api.cpp Прегледај датотеку

@@ -918,7 +918,7 @@ namespace ExtUI {
918 918
   #endif // HAS_LEVELING
919 919
 
920 920
   #if ENABLED(HOST_PROMPT_SUPPORT)
921
-    void setHostResponse(const uint8_t response) { host_response_handler(response); }
921
+    void setHostResponse(const uint8_t response) { hostui.handle_response(response); }
922 922
   #endif
923 923
 
924 924
   #if ENABLED(PRINTCOUNTER)

+ 10
- 10
Marlin/src/lcd/marlinui.cpp Прегледај датотеку

@@ -1355,7 +1355,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1355 1355
   void MarlinUI::set_status(const char * const cstr, const bool persist) {
1356 1356
     if (alert_level) return;
1357 1357
 
1358
-    TERN_(HOST_PROMPT_SUPPORT, host_action_notify(cstr));
1358
+    TERN_(HOST_PROMPT_SUPPORT, hostui.notify(cstr));
1359 1359
 
1360 1360
     // Here we have a problem. The message is encoded in UTF8, so
1361 1361
     // arbitrarily cutting it will be a problem. We MUST be sure
@@ -1427,7 +1427,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1427 1427
     if (level < alert_level) return;
1428 1428
     alert_level = level;
1429 1429
 
1430
-    TERN_(HOST_PROMPT_SUPPORT, host_action_notify(fstr));
1430
+    TERN_(HOST_PROMPT_SUPPORT, hostui.notify(fstr));
1431 1431
 
1432 1432
     // Since the message is encoded in UTF8 it must
1433 1433
     // only be cut on a character boundary.
@@ -1533,10 +1533,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1533 1533
       card.abortFilePrintSoon();
1534 1534
     #endif
1535 1535
     #ifdef ACTION_ON_CANCEL
1536
-      host_action_cancel();
1536
+      hostui.cancel();
1537 1537
     #endif
1538 1538
     IF_DISABLED(SDSUPPORT, print_job_timer.stop());
1539
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("UI Aborted"), FPSTR(DISMISS_STR)));
1539
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("UI Aborted"), FPSTR(DISMISS_STR)));
1540 1540
     LCD_MESSAGE(MSG_PRINT_ABORTED);
1541 1541
     TERN_(HAS_LCD_MENU, return_to_status());
1542 1542
   }
@@ -1565,7 +1565,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1565 1565
     #endif
1566 1566
 
1567 1567
     TERN_(HAS_TOUCH_SLEEP, wakeup_screen());
1568
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, F("UI Pause"), F("Resume")));
1568
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_PAUSE_RESUME, F("UI Pause"), F("Resume")));
1569 1569
 
1570 1570
     LCD_MESSAGE(MSG_PRINT_PAUSED);
1571 1571
 
@@ -1575,7 +1575,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1575 1575
     #elif ENABLED(SDSUPPORT)
1576 1576
       queue.inject(F("M25"));
1577 1577
     #elif defined(ACTION_ON_PAUSE)
1578
-      host_action_pause();
1578
+      hostui.pause();
1579 1579
     #endif
1580 1580
   }
1581 1581
 
@@ -1584,7 +1584,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1584 1584
     TERN_(PARK_HEAD_ON_PAUSE, wait_for_heatup = wait_for_user = false);
1585 1585
     TERN_(SDSUPPORT, if (IS_SD_PAUSED()) queue.inject_P(M24_STR));
1586 1586
     #ifdef ACTION_ON_RESUME
1587
-      host_action_resume();
1587
+      hostui.resume();
1588 1588
     #endif
1589 1589
     print_job_timer.start(); // Also called by M24
1590 1590
   }
@@ -1639,13 +1639,13 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1639 1639
   // Send the status line as a host notification
1640 1640
   //
1641 1641
   void MarlinUI::set_status(const char * const cstr, const bool) {
1642
-    TERN(HOST_PROMPT_SUPPORT, host_action_notify(cstr), UNUSED(cstr));
1642
+    TERN(HOST_PROMPT_SUPPORT, hostui.notify(cstr), UNUSED(cstr));
1643 1643
   }
1644 1644
   void MarlinUI::set_status(FSTR_P const fstr, const int8_t) {
1645
-    TERN(HOST_PROMPT_SUPPORT, host_action_notify(fstr), UNUSED(fstr));
1645
+    TERN(HOST_PROMPT_SUPPORT, hostui.notify(fstr), UNUSED(fstr));
1646 1646
   }
1647 1647
   void MarlinUI::status_printf(const uint8_t, FSTR_P const fstr, ...) {
1648
-    TERN(HOST_PROMPT_SUPPORT, host_action_notify(fstr), UNUSED(fstr));
1648
+    TERN(HOST_PROMPT_SUPPORT, hostui.notify(fstr), UNUSED(fstr));
1649 1649
   }
1650 1650
 
1651 1651
 #endif // !HAS_DISPLAY && !HAS_STATUS_MESSAGE

+ 2
- 2
Marlin/src/lcd/menu/menu_delta_calibrate.cpp Прегледај датотеку

@@ -58,13 +58,13 @@ void _man_probe_pt(const xy_pos_t &xy) {
58 58
     #include "../../MarlinCore.h" // for wait_for_user_response()
59 59
   #endif
60 60
   #if ENABLED(HOST_PROMPT_SUPPORT)
61
-    #include "../../feature/host_actions.h" // for host_prompt_do
61
+    #include "../../feature/host_actions.h" // for hostui.prompt_do
62 62
   #endif
63 63
 
64 64
   float lcd_probe_pt(const xy_pos_t &xy) {
65 65
     _man_probe_pt(xy);
66 66
     ui.defer_status_screen();
67
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Delta Calibration in progress"), FPSTR(CONTINUE_STR)));
67
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Delta Calibration in progress"), FPSTR(CONTINUE_STR)));
68 68
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Delta Calibration in progress")));
69 69
     TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
70 70
     ui.goto_previous_screen_no_defer();

+ 1
- 1
Marlin/src/lcd/menu/menu_main.cpp Прегледај датотеку

@@ -301,7 +301,7 @@ void menu_main() {
301 301
       ACTION_ITEM(MSG_RESUME_PRINT, ui.resume_print);
302 302
 
303 303
     #if ENABLED(HOST_START_MENU_ITEM) && defined(ACTION_ON_START)
304
-      ACTION_ITEM(MSG_HOST_START_PRINT, host_action_start);
304
+      ACTION_ITEM(MSG_HOST_START_PRINT, hostui.start);
305 305
     #endif
306 306
 
307 307
     #if ENABLED(PREHEAT_SHORTCUT_MENU_ITEM)

+ 2
- 2
Marlin/src/module/probe.cpp Прегледај датотеку

@@ -140,7 +140,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
140 140
       LCD_MESSAGE(MSG_MANUAL_DEPLOY_TOUCHMI);
141 141
       ui.return_to_status();
142 142
 
143
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Deploy TouchMI"), FPSTR(CONTINUE_STR)));
143
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Deploy TouchMI"), FPSTR(CONTINUE_STR)));
144 144
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
145 145
       ui.reset_status();
146 146
       ui.goto_screen(prev_screen);
@@ -295,7 +295,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
295 295
       ui.set_status(ds_str, 99);
296 296
       SERIAL_ECHOLNF(ds_str);
297 297
 
298
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Stow Probe"), FPSTR(CONTINUE_STR)));
298
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Stow Probe"), FPSTR(CONTINUE_STR)));
299 299
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Stow Probe")));
300 300
       TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, F("Stow Probe"), FPSTR(CONTINUE_STR)));
301 301
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());

Loading…
Откажи
Сачувај