Skip to content

Commit

Permalink
Broadcast host actions
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and vgadreau committed Dec 9, 2020
1 parent 8c5eb29 commit fa160cd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Marlin/src/feature/host_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#endif

void host_action(PGM_P const pstr, const bool eol) {
PORT_REDIRECT(SERIAL_BOTH);
SERIAL_ECHOPGM("//action:");
serialprintPGM(pstr);
if (eol) SERIAL_EOL();
Expand Down Expand Up @@ -74,25 +75,28 @@ void host_action(PGM_P const pstr, const bool eol) {
PromptReason host_prompt_reason = PROMPT_NOT_DEFINED;

void host_action_notify(const char * const message) {
PORT_REDIRECT(SERIAL_BOTH);
host_action(PSTR("notification "), false);
SERIAL_ECHO(message);
SERIAL_EOL();
SERIAL_ECHOLN(message);
}

void host_action_notify_P(PGM_P const message) {
PORT_REDIRECT(SERIAL_BOTH);
host_action(PSTR("notification "), false);
serialprintPGM(message);
SERIAL_EOL();
}

void host_action_prompt(PGM_P const ptype, const bool eol=true) {
PORT_REDIRECT(SERIAL_BOTH);
host_action(PSTR("prompt_"), false);
serialprintPGM(ptype);
if (eol) SERIAL_EOL();
}

void host_action_prompt_plus(PGM_P const ptype, PGM_P const pstr, const char extra_char='\0') {
host_action_prompt(ptype, false);
PORT_REDIRECT(SERIAL_BOTH);
SERIAL_CHAR(' ');
serialprintPGM(pstr);
if (extra_char != '\0') SERIAL_CHAR(extra_char);
Expand Down

0 comments on commit fa160cd

Please sign in to comment.