Browse Source

🧑‍💻 Drop hostui.flag

Scott Lahteine 3 years ago
parent
commit
2d04e5733a

+ 0
- 8
Marlin/src/feature/host_actions.cpp View File

39
 
39
 
40
 HostUI hostui;
40
 HostUI hostui;
41
 
41
 
42
-flag_t HostUI::flag;
43
-
44
 void HostUI::action(FSTR_P const fstr, const bool eol) {
42
 void HostUI::action(FSTR_P const fstr, const bool eol) {
45
-  if (!flag.bits) return;
46
   PORT_REDIRECT(SerialMask::All);
43
   PORT_REDIRECT(SerialMask::All);
47
   SERIAL_ECHOPGM("//action:");
44
   SERIAL_ECHOPGM("//action:");
48
   SERIAL_ECHOF(fstr);
45
   SERIAL_ECHOF(fstr);
96
   #endif
93
   #endif
97
 
94
 
98
   void HostUI::notify(const char * const cstr) {
95
   void HostUI::notify(const char * const cstr) {
99
-    if (!flag.bits) return;
100
     PORT_REDIRECT(SerialMask::All);
96
     PORT_REDIRECT(SerialMask::All);
101
     action(F("notification "), false);
97
     action(F("notification "), false);
102
     SERIAL_ECHOLN(cstr);
98
     SERIAL_ECHOLN(cstr);
103
   }
99
   }
104
 
100
 
105
   void HostUI::notify_P(PGM_P const pstr) {
101
   void HostUI::notify_P(PGM_P const pstr) {
106
-    if (!flag.bits) return;
107
     PORT_REDIRECT(SerialMask::All);
102
     PORT_REDIRECT(SerialMask::All);
108
     action(F("notification "), false);
103
     action(F("notification "), false);
109
     SERIAL_ECHOLNPGM_P(pstr);
104
     SERIAL_ECHOLNPGM_P(pstr);
110
   }
105
   }
111
 
106
 
112
   void HostUI::prompt(FSTR_P const ptype, const bool eol/*=true*/) {
107
   void HostUI::prompt(FSTR_P const ptype, const bool eol/*=true*/) {
113
-    if (!flag.bits) return;
114
     PORT_REDIRECT(SerialMask::All);
108
     PORT_REDIRECT(SerialMask::All);
115
     action(F("prompt_"), false);
109
     action(F("prompt_"), false);
116
     SERIAL_ECHOF(ptype);
110
     SERIAL_ECHOF(ptype);
118
   }
112
   }
119
 
113
 
120
   void HostUI::prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char/*='\0'*/) {
114
   void HostUI::prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char/*='\0'*/) {
121
-    if (!flag.bits) return;
122
     prompt(ptype, false);
115
     prompt(ptype, false);
123
     PORT_REDIRECT(SerialMask::All);
116
     PORT_REDIRECT(SerialMask::All);
124
     SERIAL_CHAR(' ');
117
     SERIAL_CHAR(' ');
127
     SERIAL_EOL();
120
     SERIAL_EOL();
128
   }
121
   }
129
   void HostUI::prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) {
122
   void HostUI::prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) {
130
-    if (!flag.bits) return;
131
     prompt_end();
123
     prompt_end();
132
     host_prompt_reason = reason;
124
     host_prompt_reason = reason;
133
     prompt_plus(F("begin"), fstr, extra_char);
125
     prompt_plus(F("begin"), fstr, extra_char);

+ 0
- 8
Marlin/src/feature/host_actions.h View File

24
 #include "../inc/MarlinConfigPre.h"
24
 #include "../inc/MarlinConfigPre.h"
25
 #include "../HAL/shared/Marduino.h"
25
 #include "../HAL/shared/Marduino.h"
26
 
26
 
27
-typedef union {
28
-  uint8_t bits;
29
-  struct { bool info:1, errors:1, debug:1; };
30
-} flag_t;
31
-
32
 #if ENABLED(HOST_PROMPT_SUPPORT)
27
 #if ENABLED(HOST_PROMPT_SUPPORT)
33
 
28
 
34
   enum PromptReason : uint8_t {
29
   enum PromptReason : uint8_t {
45
 class HostUI {
40
 class HostUI {
46
   public:
41
   public:
47
 
42
 
48
-  static flag_t flag;
49
-  HostUI() { flag.bits = 0xFF; }
50
-
51
   static void action(FSTR_P const fstr, const bool eol=true);
43
   static void action(FSTR_P const fstr, const bool eol=true);
52
 
44
 
53
   #ifdef ACTION_ON_KILL
45
   #ifdef ACTION_ON_KILL

+ 0
- 8
Marlin/src/gcode/control/M111.cpp View File

22
 
22
 
23
 #include "../gcode.h"
23
 #include "../gcode.h"
24
 
24
 
25
-#if ENABLED(HOST_ACTION_COMMANDS)
26
-  #include "../../feature/host_actions.h"
27
-#endif
28
-
29
 /**
25
 /**
30
  * M111: Set the debug level
26
  * M111: Set the debug level
31
  */
27
  */
32
 void GcodeSuite::M111() {
28
 void GcodeSuite::M111() {
33
   if (parser.seenval('S')) marlin_debug_flags = parser.value_byte();
29
   if (parser.seenval('S')) marlin_debug_flags = parser.value_byte();
34
 
30
 
35
-  #if EITHER(HOST_ACTION_COMMANDS, HOST_PROMPT_SUPPORT)
36
-    if (parser.seenval('H')) hostui.flag.bits = parser.value_byte();
37
-  #endif
38
-
39
   static PGMSTR(str_debug_1, STR_DEBUG_ECHO);
31
   static PGMSTR(str_debug_1, STR_DEBUG_ECHO);
40
   static PGMSTR(str_debug_2, STR_DEBUG_INFO);
32
   static PGMSTR(str_debug_2, STR_DEBUG_INFO);
41
   static PGMSTR(str_debug_4, STR_DEBUG_ERRORS);
33
   static PGMSTR(str_debug_4, STR_DEBUG_ERRORS);

Loading…
Cancel
Save