|
@@ -37,7 +37,7 @@
|
37
|
37
|
#include "runout.h"
|
38
|
38
|
#endif
|
39
|
39
|
|
40
|
|
-void host_action(const char * const pstr, const bool eol) {
|
|
40
|
+void host_action(PGM_P const pstr, const bool eol) {
|
41
|
41
|
SERIAL_ECHOPGM("//action:");
|
42
|
42
|
serialprintPGM(pstr);
|
43
|
43
|
if (eol) SERIAL_EOL();
|
|
@@ -75,32 +75,38 @@ void host_action(const char * const pstr, const bool eol) {
|
75
|
75
|
|
76
|
76
|
void host_action_notify(const char * const message) {
|
77
|
77
|
host_action(PSTR("notification "), false);
|
|
78
|
+ SERIAL_ECHO(message);
|
|
79
|
+ SERIAL_EOL();
|
|
80
|
+ }
|
|
81
|
+
|
|
82
|
+ void host_action_notify_P(PGM_P const message) {
|
|
83
|
+ host_action(PSTR("notification "), false);
|
78
|
84
|
serialprintPGM(message);
|
79
|
85
|
SERIAL_EOL();
|
80
|
86
|
}
|
81
|
87
|
|
82
|
|
- void host_action_prompt(const char * const ptype, const bool eol=true) {
|
|
88
|
+ void host_action_prompt(PGM_P const ptype, const bool eol=true) {
|
83
|
89
|
host_action(PSTR("prompt_"), false);
|
84
|
90
|
serialprintPGM(ptype);
|
85
|
91
|
if (eol) SERIAL_EOL();
|
86
|
92
|
}
|
87
|
93
|
|
88
|
|
- void host_action_prompt_plus(const char * const ptype, const char * const pstr, const char extra_char='\0') {
|
|
94
|
+ void host_action_prompt_plus(PGM_P const ptype, PGM_P const pstr, const char extra_char='\0') {
|
89
|
95
|
host_action_prompt(ptype, false);
|
90
|
96
|
SERIAL_CHAR(' ');
|
91
|
97
|
serialprintPGM(pstr);
|
92
|
98
|
if (extra_char != '\0') SERIAL_CHAR(extra_char);
|
93
|
99
|
SERIAL_EOL();
|
94
|
100
|
}
|
95
|
|
- void host_action_prompt_begin(const PromptReason reason, const char * const pstr, const char extra_char/*='\0'*/) {
|
|
101
|
+ void host_action_prompt_begin(const PromptReason reason, PGM_P const pstr, const char extra_char/*='\0'*/) {
|
96
|
102
|
host_action_prompt_end();
|
97
|
103
|
host_prompt_reason = reason;
|
98
|
104
|
host_action_prompt_plus(PSTR("begin"), pstr, extra_char);
|
99
|
105
|
}
|
100
|
|
- void host_action_prompt_button(const char * const pstr) { host_action_prompt_plus(PSTR("button"), pstr); }
|
|
106
|
+ void host_action_prompt_button(PGM_P const pstr) { host_action_prompt_plus(PSTR("button"), pstr); }
|
101
|
107
|
void host_action_prompt_end() { host_action_prompt(PSTR("end")); }
|
102
|
108
|
void host_action_prompt_show() { host_action_prompt(PSTR("show")); }
|
103
|
|
- void host_prompt_do(const PromptReason reason, const char * const pstr, const char * const btn1/*=nullptr*/, const char * const btn2/*=nullptr*/) {
|
|
109
|
+ void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) {
|
104
|
110
|
host_action_prompt_begin(reason, pstr);
|
105
|
111
|
if (btn1) host_action_prompt_button(btn1);
|
106
|
112
|
if (btn2) host_action_prompt_button(btn2);
|
|
@@ -127,7 +133,7 @@ void host_action(const char * const pstr, const bool eol) {
|
127
|
133
|
serialprintPGM(m876_prefix); SERIAL_ECHOLNPAIR("ason: ", host_prompt_reason);
|
128
|
134
|
serialprintPGM(m876_prefix); SERIAL_ECHOLNPAIR("sponse: ", response);
|
129
|
135
|
#endif
|
130
|
|
- const char *msg = PSTR("UNKNOWN STATE");
|
|
136
|
+ PGM_P msg = PSTR("UNKNOWN STATE");
|
131
|
137
|
const PromptReason hpr = host_prompt_reason;
|
132
|
138
|
host_prompt_reason = PROMPT_NOT_DEFINED; // Reset now ahead of logic
|
133
|
139
|
switch (hpr) {
|