1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 12:04:19 +00:00

🧑‍💻 Drop hostui.flag

This commit is contained in:
Scott Lahteine 2022-02-08 18:02:28 -06:00
parent b964d2fff0
commit 38484c6eb6
3 changed files with 0 additions and 24 deletions

View File

@ -39,10 +39,7 @@
HostUI hostui;
flag_t HostUI::flag;
void HostUI::action(FSTR_P const fstr, const bool eol) {
if (!flag.bits) return;
PORT_REDIRECT(SerialMask::All);
SERIAL_ECHOPGM("//action:");
SERIAL_ECHOF(fstr);
@ -96,21 +93,18 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
#endif
void HostUI::notify(const char * const cstr) {
if (!flag.bits) return;
PORT_REDIRECT(SerialMask::All);
action(F("notification "), false);
SERIAL_ECHOLN(cstr);
}
void HostUI::notify_P(PGM_P const pstr) {
if (!flag.bits) return;
PORT_REDIRECT(SerialMask::All);
action(F("notification "), false);
SERIAL_ECHOLNPGM_P(pstr);
}
void HostUI::prompt(FSTR_P const ptype, const bool eol/*=true*/) {
if (!flag.bits) return;
PORT_REDIRECT(SerialMask::All);
action(F("prompt_"), false);
SERIAL_ECHOF(ptype);
@ -118,7 +112,6 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
}
void HostUI::prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char/*='\0'*/) {
if (!flag.bits) return;
prompt(ptype, false);
PORT_REDIRECT(SerialMask::All);
SERIAL_CHAR(' ');
@ -127,7 +120,6 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
SERIAL_EOL();
}
void HostUI::prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) {
if (!flag.bits) return;
prompt_end();
host_prompt_reason = reason;
prompt_plus(F("begin"), fstr, extra_char);

View File

@ -24,11 +24,6 @@
#include "../inc/MarlinConfigPre.h"
#include "../HAL/shared/Marduino.h"
typedef union {
uint8_t bits;
struct { bool info:1, errors:1, debug:1; };
} flag_t;
#if ENABLED(HOST_PROMPT_SUPPORT)
enum PromptReason : uint8_t {
@ -45,9 +40,6 @@ typedef union {
class HostUI {
public:
static flag_t flag;
HostUI() { flag.bits = 0xFF; }
static void action(FSTR_P const fstr, const bool eol=true);
#ifdef ACTION_ON_KILL

View File

@ -22,20 +22,12 @@
#include "../gcode.h"
#if ENABLED(HOST_ACTION_COMMANDS)
#include "../../feature/host_actions.h"
#endif
/**
* M111: Set the debug level
*/
void GcodeSuite::M111() {
if (parser.seenval('S')) marlin_debug_flags = parser.value_byte();
#if EITHER(HOST_ACTION_COMMANDS, HOST_PROMPT_SUPPORT)
if (parser.seenval('H')) hostui.flag.bits = parser.value_byte();
#endif
static PGMSTR(str_debug_1, STR_DEBUG_ECHO);
static PGMSTR(str_debug_2, STR_DEBUG_INFO);
static PGMSTR(str_debug_4, STR_DEBUG_ERRORS);