🎨 Apply F() to serial macros

This commit is contained in:
Scott Lahteine
2021-09-27 11:03:07 -05:00
parent 417e2530eb
commit 520b97083e
30 changed files with 187 additions and 147 deletions

View File

@@ -26,22 +26,22 @@
class SectionLog {
public:
SectionLog(PGM_P const msg=nullptr, bool inbug=true) {
the_msg = msg;
if ((debug = inbug)) echo_msg(PSTR(">>>"));
SectionLog(FSTR_P const fmsg=nullptr, bool inbug=true) {
the_msg = fmsg;
if ((debug = inbug)) echo_msg(F(">>>"));
}
~SectionLog() { if (debug) echo_msg(PSTR("<<<")); }
~SectionLog() { if (debug) echo_msg(F("<<<")); }
private:
PGM_P the_msg;
FSTR_P the_msg;
bool debug;
void echo_msg(PGM_P const pre) {
SERIAL_ECHOPGM_P(pre);
void echo_msg(FSTR_P const fpre) {
SERIAL_ECHOF(fpre);
if (the_msg) {
SERIAL_CHAR(' ');
SERIAL_ECHOPGM_P(the_msg);
SERIAL_ECHOF(the_msg);
}
SERIAL_CHAR(' ');
print_pos(current_position);