Serial macros cleanup

This commit is contained in:
Scott Lahteine 2021-02-28 19:43:46 -06:00 committed by Scott Lahteine
parent f0b662ff58
commit dd42831cba
48 changed files with 101 additions and 117 deletions

View file

@ -83,14 +83,13 @@ bool PersistentStore::access_finish() {
static void debug_rw(const bool write, int &pos, const uint8_t *value, const size_t size, const FRESULT s, const size_t total=0) { static void debug_rw(const bool write, int &pos, const uint8_t *value, const size_t size, const FRESULT s, const size_t total=0) {
PGM_P const rw_str = write ? PSTR("write") : PSTR("read"); PGM_P const rw_str = write ? PSTR("write") : PSTR("read");
SERIAL_CHAR(' '); SERIAL_CHAR(' ');
serialprintPGM(rw_str); SERIAL_ECHOPGM_P(rw_str);
SERIAL_ECHOLNPAIR("_data(", pos, ",", value, ",", size, ", ...)"); SERIAL_ECHOLNPAIR("_data(", pos, ",", value, ",", size, ", ...)");
if (total) { if (total) {
SERIAL_ECHOPGM(" f_"); SERIAL_ECHOPGM(" f_");
serialprintPGM(rw_str); SERIAL_ECHOPGM_P(rw_str);
SERIAL_ECHOPAIR("()=", s, "\n size=", size, "\n bytes_"); SERIAL_ECHOPAIR("()=", s, "\n size=", size, "\n bytes_");
serialprintPGM(write ? PSTR("written=") : PSTR("read=")); SERIAL_ECHOLNPAIR_P(write ? PSTR("written=") : PSTR("read="), total);
SERIAL_ECHOLN(total);
} }
else else
SERIAL_ECHOLNPAIR(" f_lseek()=", s); SERIAL_ECHOLNPAIR(" f_lseek()=", s);

View file

@ -109,11 +109,11 @@
void dump_delay_accuracy_check() { void dump_delay_accuracy_check() {
auto report_call_time = [](PGM_P const name, PGM_P const unit, const uint32_t cycles, const uint32_t total, const bool do_flush=true) { auto report_call_time = [](PGM_P const name, PGM_P const unit, const uint32_t cycles, const uint32_t total, const bool do_flush=true) {
SERIAL_ECHOPGM("Calling "); SERIAL_ECHOPGM("Calling ");
serialprintPGM(name); SERIAL_ECHOPGM_P(name);
SERIAL_ECHOLNPAIR(" for ", cycles); SERIAL_ECHOLNPAIR(" for ", cycles);
serialprintPGM(unit); SERIAL_ECHOPGM_P(unit);
SERIAL_ECHOLNPAIR(" took: ", total); SERIAL_ECHOLNPAIR(" took: ", total);
serialprintPGM(unit); SERIAL_ECHOPGM_P(unit);
if (do_flush) SERIAL_FLUSHTX(); if (do_flush) SERIAL_FLUSHTX();
}; };
@ -169,10 +169,7 @@
void calibrate_delay_loop() {} void calibrate_delay_loop() {}
#if ENABLED(MARLIN_DEV_MODE) #if ENABLED(MARLIN_DEV_MODE)
void dump_delay_accuracy_check() { void dump_delay_accuracy_check() { SERIAL_ECHOPGM_P(PSTR("N/A on this platform")); }
static PGMSTR(none, "N/A on this platform");
serialprintPGM(none);
}
#endif #endif
#endif #endif

View file

@ -885,8 +885,7 @@ void setup() {
auto log_current_ms = [&](PGM_P const msg) { auto log_current_ms = [&](PGM_P const msg) {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_CHAR('['); SERIAL_ECHO(millis()); SERIAL_ECHOPGM("] "); SERIAL_CHAR('['); SERIAL_ECHO(millis()); SERIAL_ECHOPGM("] ");
serialprintPGM(msg); SERIAL_ECHOLNPGM_P(msg);
SERIAL_EOL();
}; };
#define SETUP_LOG(M) log_current_ms(PSTR(M)) #define SETUP_LOG(M) log_current_ms(PSTR(M))
#else #else
@ -1003,7 +1002,7 @@ void setup() {
if (mcu & RST_SOFTWARE) SERIAL_ECHOLNPGM(STR_SOFTWARE_RESET); if (mcu & RST_SOFTWARE) SERIAL_ECHOLNPGM(STR_SOFTWARE_RESET);
HAL_clear_reset_source(); HAL_clear_reset_source();
serialprintPGM(GET_TEXT(MSG_MARLIN)); SERIAL_ECHOPGM_P(GET_TEXT(MSG_MARLIN));
SERIAL_CHAR(' '); SERIAL_CHAR(' ');
SERIAL_ECHOLNPGM(SHORT_BUILD_VERSION); SERIAL_ECHOLNPGM(SHORT_BUILD_VERSION);
SERIAL_EOL(); SERIAL_EOL();

View file

@ -59,7 +59,7 @@
#include "debug_section.h" #include "debug_section.h"
#define DEBUG_SECTION(N,S,D) SectionLog N(PSTR(S),D) #define DEBUG_SECTION(N,S,D) SectionLog N(PSTR(S),D)
#define DEBUG_PRINT_P(P) serialprintPGM(P) #define DEBUG_ECHOPGM_P(P) SERIAL_ECHOPGM_P(P)
#define DEBUG_ECHO_START SERIAL_ECHO_START #define DEBUG_ECHO_START SERIAL_ECHO_START
#define DEBUG_ERROR_START SERIAL_ERROR_START #define DEBUG_ERROR_START SERIAL_ERROR_START
#define DEBUG_CHAR SERIAL_CHAR #define DEBUG_CHAR SERIAL_CHAR
@ -89,7 +89,7 @@
#else #else
#define DEBUG_SECTION(...) NOOP #define DEBUG_SECTION(...) NOOP
#define DEBUG_PRINT_P(P) NOOP #define DEBUG_ECHOPGM_P(P) NOOP
#define DEBUG_ECHO_START() NOOP #define DEBUG_ECHO_START() NOOP
#define DEBUG_ERROR_START() NOOP #define DEBUG_ERROR_START() NOOP
#define DEBUG_CHAR(...) NOOP #define DEBUG_CHAR(...) NOOP

View file

@ -38,10 +38,10 @@ private:
bool debug; bool debug;
void echo_msg(PGM_P const pre) { void echo_msg(PGM_P const pre) {
serialprintPGM(pre); SERIAL_ECHOPGM_P(pre);
if (the_msg) { if (the_msg) {
SERIAL_CHAR(' '); SERIAL_CHAR(' ');
serialprintPGM(the_msg); SERIAL_ECHOPGM_P(the_msg);
} }
SERIAL_CHAR(' '); SERIAL_CHAR(' ');
print_xyz(current_position); print_xyz(current_position);

View file

@ -92,9 +92,9 @@ void safe_delay(millis_t ms) {
SERIAL_ECHOPGM(" (Aligned With"); SERIAL_ECHOPGM(" (Aligned With");
if (probe.offset_xy.y > 0) if (probe.offset_xy.y > 0)
serialprintPGM(ENABLED(IS_SCARA) ? PSTR("-Distal") : PSTR("-Back")); SERIAL_ECHOPGM_P(ENABLED(IS_SCARA) ? PSTR("-Distal") : PSTR("-Back"));
else if (probe.offset_xy.y < 0) else if (probe.offset_xy.y < 0)
serialprintPGM(ENABLED(IS_SCARA) ? PSTR("-Proximal") : PSTR("-Front")); SERIAL_ECHOPGM_P(ENABLED(IS_SCARA) ? PSTR("-Proximal") : PSTR("-Front"));
else if (probe.offset_xy.x != 0) else if (probe.offset_xy.x != 0)
SERIAL_ECHOPGM("-Center"); SERIAL_ECHOPGM("-Center");
@ -102,7 +102,7 @@ void safe_delay(millis_t ms) {
#endif #endif
serialprintPGM(probe.offset.z < 0 ? PSTR("Below") : probe.offset.z > 0 ? PSTR("Above") : PSTR("Same Z as")); SERIAL_ECHOPGM_P(probe.offset.z < 0 ? PSTR("Below") : probe.offset.z > 0 ? PSTR("Above") : PSTR("Same Z as"));
SERIAL_ECHOLNPGM(" Nozzle)"); SERIAL_ECHOLNPGM(" Nozzle)");
#endif #endif

View file

@ -181,7 +181,7 @@ void unified_bed_leveling::display_map(const int map_type) {
} }
else { else {
SERIAL_ECHOPGM(" for "); SERIAL_ECHOPGM(" for ");
serialprintPGM(csv ? PSTR("CSV:\n") : PSTR("LCD:\n")); SERIAL_ECHOPGM_P(csv ? PSTR("CSV:\n") : PSTR("LCD:\n"));
} }
// Add XY probe offset from extruder because probe.probe_at_point() subtracts them when // Add XY probe offset from extruder because probe.probe_at_point() subtracts them when
@ -212,7 +212,7 @@ void unified_bed_leveling::display_map(const int map_type) {
// TODO: Display on Graphical LCD // TODO: Display on Graphical LCD
} }
else if (isnan(f)) else if (isnan(f))
serialprintPGM(human ? PSTR(" . ") : PSTR("NAN")); SERIAL_ECHOPGM_P(human ? PSTR(" . ") : PSTR("NAN"));
else if (human || csv) { else if (human || csv) {
if (human && f >= 0.0) SERIAL_CHAR(f > 0 ? '+' : ' '); // Display sign also for positive numbers (' ' for 0) if (human && f >= 0.0) SERIAL_CHAR(f > 0 ? '+' : ' '); // Display sign also for positive numbers (' ' for 0)
SERIAL_ECHO_F(f, 3); // Positive: 5 digits, Negative: 6 digits SERIAL_ECHO_F(f, 3); // Positive: 5 digits, Negative: 6 digits

View file

@ -908,11 +908,11 @@ void unified_bed_leveling::shift_mesh_height() {
if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing
if (parser.seen('B')) { if (parser.seen('B')) {
serialprintPGM(GET_TEXT(MSG_UBL_BC_INSERT)); SERIAL_ECHOPGM_P(GET_TEXT(MSG_UBL_BC_INSERT));
LCD_MESSAGEPGM(MSG_UBL_BC_INSERT); LCD_MESSAGEPGM(MSG_UBL_BC_INSERT);
} }
else { else {
serialprintPGM(GET_TEXT(MSG_UBL_BC_INSERT2)); SERIAL_ECHOPGM_P(GET_TEXT(MSG_UBL_BC_INSERT2));
LCD_MESSAGEPGM(MSG_UBL_BC_INSERT2); LCD_MESSAGEPGM(MSG_UBL_BC_INSERT2);
} }
@ -1576,7 +1576,7 @@ void unified_bed_leveling::smart_fill_mesh() {
return normal.x * pos.x + normal.y * pos.y + zadd; return normal.x * pos.x + normal.y * pos.y + zadd;
}; };
auto debug_pt = [](PGM_P const pre, const xy_pos_t &pos, const float &zadd) { auto debug_pt = [](PGM_P const pre, const xy_pos_t &pos, const float &zadd) {
d_from(); serialprintPGM(pre); d_from(); SERIAL_ECHOPGM_P(pre);
DEBUG_ECHO_F(normed(pos, zadd), 6); DEBUG_ECHO_F(normed(pos, zadd), 6);
DEBUG_ECHOLNPAIR_F(" Z error = ", zadd - get_z_correction(pos), 6); DEBUG_ECHOLNPAIR_F(" Z error = ", zadd - get_z_correction(pos), 6);
}; };

View file

@ -40,7 +40,7 @@
void host_action(PGM_P const pstr, const bool eol) { void host_action(PGM_P const pstr, const bool eol) {
PORT_REDIRECT(SERIAL_ALL); PORT_REDIRECT(SERIAL_ALL);
SERIAL_ECHOPGM("//action:"); SERIAL_ECHOPGM("//action:");
serialprintPGM(pstr); SERIAL_ECHOPGM_P(pstr);
if (eol) SERIAL_EOL(); if (eol) SERIAL_EOL();
} }
@ -86,14 +86,13 @@ void host_action(PGM_P const pstr, const bool eol) {
void host_action_notify_P(PGM_P const message) { void host_action_notify_P(PGM_P const message) {
PORT_REDIRECT(SERIAL_ALL); PORT_REDIRECT(SERIAL_ALL);
host_action(PSTR("notification "), false); host_action(PSTR("notification "), false);
serialprintPGM(message); SERIAL_ECHOLNPGM_P(message);
SERIAL_EOL();
} }
void host_action_prompt(PGM_P const ptype, const bool eol=true) { void host_action_prompt(PGM_P const ptype, const bool eol=true) {
PORT_REDIRECT(SERIAL_ALL); PORT_REDIRECT(SERIAL_ALL);
host_action(PSTR("prompt_"), false); host_action(PSTR("prompt_"), false);
serialprintPGM(ptype); SERIAL_ECHOPGM_P(ptype);
if (eol) SERIAL_EOL(); if (eol) SERIAL_EOL();
} }
@ -101,7 +100,7 @@ void host_action(PGM_P const pstr, const bool eol) {
host_action_prompt(ptype, false); host_action_prompt(ptype, false);
PORT_REDIRECT(SERIAL_ALL); PORT_REDIRECT(SERIAL_ALL);
SERIAL_CHAR(' '); SERIAL_CHAR(' ');
serialprintPGM(pstr); SERIAL_ECHOPGM_P(pstr);
if (extra_char != '\0') SERIAL_CHAR(extra_char); if (extra_char != '\0') SERIAL_CHAR(extra_char);
SERIAL_EOL(); SERIAL_EOL();
} }

View file

@ -127,7 +127,7 @@ uint8_t Max7219::suspended; // = 0;
void Max7219::error(const char * const func, const int32_t v1, const int32_t v2/*=-1*/) { void Max7219::error(const char * const func, const int32_t v1, const int32_t v2/*=-1*/) {
#if ENABLED(MAX7219_ERRORS) #if ENABLED(MAX7219_ERRORS)
SERIAL_ECHOPGM("??? Max7219::"); SERIAL_ECHOPGM("??? Max7219::");
serialprintPGM(func); SERIAL_ECHOPGM_P(func);
SERIAL_CHAR('('); SERIAL_CHAR('(');
SERIAL_ECHO(v1); SERIAL_ECHO(v1);
if (v2 > 0) SERIAL_ECHOPAIR(", ", v2); if (v2 > 0) SERIAL_ECHOPAIR(", ", v2);

View file

@ -179,7 +179,7 @@ void MeatPack::report_state() {
SERIAL_ECHOPGM("[MP] "); SERIAL_ECHOPGM("[MP] ");
SERIAL_ECHOPGM(MeatPack_ProtocolVersion " "); SERIAL_ECHOPGM(MeatPack_ProtocolVersion " ");
serialprint_onoff(TEST(state, MPConfig_Bit_Active)); serialprint_onoff(TEST(state, MPConfig_Bit_Active));
serialprintPGM(TEST(state, MPConfig_Bit_NoSpaces) ? PSTR(" NSP\n") : PSTR(" ESP\n")); SERIAL_ECHOPGM_P(TEST(state, MPConfig_Bit_NoSpaces) ? PSTR(" NSP\n") : PSTR(" ESP\n"));
} }
/** /**

View file

@ -460,7 +460,7 @@ void show_continue_prompt(const bool is_reload) {
ui.pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING); ui.pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING);
SERIAL_ECHO_START(); SERIAL_ECHO_START();
serialprintPGM(is_reload ? PSTR(_PMSG(STR_FILAMENT_CHANGE_INSERT) "\n") : PSTR(_PMSG(STR_FILAMENT_CHANGE_WAIT) "\n")); SERIAL_ECHOPGM_P(is_reload ? PSTR(_PMSG(STR_FILAMENT_CHANGE_INSERT) "\n") : PSTR(_PMSG(STR_FILAMENT_CHANGE_WAIT) "\n"));
} }
void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep_count/*=0*/ DXC_ARGS) { void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep_count/*=0*/ DXC_ARGS) {

View file

@ -531,7 +531,7 @@ void PrintJobRecovery::resume() {
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY) #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
void PrintJobRecovery::debug(PGM_P const prefix) { void PrintJobRecovery::debug(PGM_P const prefix) {
DEBUG_PRINT_P(prefix); DEBUG_ECHOPGM_P(prefix);
DEBUG_ECHOLNPAIR(" Job Recovery Info...\nvalid_head:", info.valid_head, " valid_foot:", info.valid_foot); DEBUG_ECHOLNPAIR(" Job Recovery Info...\nvalid_head:", info.valid_head, " valid_foot:", info.valid_foot);
if (info.valid_head) { if (info.valid_head) {
if (info.valid_head == info.valid_foot) { if (info.valid_head == info.valid_foot) {

View file

@ -73,7 +73,7 @@ void ProbeTempComp::print_offsets() {
LOOP_L_N(s, TSI_COUNT) { LOOP_L_N(s, TSI_COUNT) {
float temp = cali_info[s].start_temp; float temp = cali_info[s].start_temp;
for (int16_t i = -1; i < cali_info[s].measurements; ++i) { for (int16_t i = -1; i < cali_info[s].measurements; ++i) {
serialprintPGM(s == TSI_BED ? PSTR("Bed") : SERIAL_ECHOPGM_P(s == TSI_BED ? PSTR("Bed") :
#if ENABLED(USE_TEMP_EXT_COMPENSATION) #if ENABLED(USE_TEMP_EXT_COMPENSATION)
s == TSI_EXT ? PSTR("Extruder") : s == TSI_EXT ? PSTR("Extruder") :
#endif #endif

View file

@ -287,7 +287,7 @@ class FilamentSensorBase {
if (out != was_out) { if (out != was_out) {
was_out = out; was_out = out;
SERIAL_ECHOPGM("Filament "); SERIAL_ECHOPGM("Filament ");
serialprintPGM(out ? PSTR("OUT\n") : PSTR("IN\n")); SERIAL_ECHOPGM_P(out ? PSTR("OUT\n") : PSTR("IN\n"));
} }
#endif #endif
} }
@ -320,10 +320,8 @@ class FilamentSensorBase {
const millis_t ms = millis(); const millis_t ms = millis();
if (ELAPSED(ms, t)) { if (ELAPSED(ms, t)) {
t = millis() + 1000UL; t = millis() + 1000UL;
LOOP_L_N(i, EXTRUDERS) { LOOP_L_N(i, EXTRUDERS)
serialprintPGM(i ? PSTR(", ") : PSTR("Remaining mm: ")); SERIAL_ECHOPAIR_P(i ? PSTR(", ") : PSTR("Remaining mm: "), runout_mm_countdown[i]);
SERIAL_ECHO(runout_mm_countdown[i]);
}
SERIAL_EOL(); SERIAL_EOL();
} }
#endif #endif

View file

@ -546,7 +546,7 @@
}; };
template<class TMC> template<class TMC>
static void print_vsense(TMC &st) { serialprintPGM(st.vsense() ? PSTR("1=.18") : PSTR("0=.325")); } static void print_vsense(TMC &st) { SERIAL_ECHOPGM_P(st.vsense() ? PSTR("1=.18") : PSTR("0=.325")); }
#if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC5130) #if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC5130)
static void _tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) { static void _tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) {
@ -717,7 +717,7 @@
SERIAL_ECHO(st.cs()); SERIAL_ECHO(st.cs());
SERIAL_ECHOPGM("/31"); SERIAL_ECHOPGM("/31");
break; break;
case TMC_VSENSE: serialprintPGM(st.vsense() ? PSTR("1=.165") : PSTR("0=.310")); break; case TMC_VSENSE: SERIAL_ECHOPGM_P(st.vsense() ? PSTR("1=.165") : PSTR("0=.310")); break;
case TMC_MICROSTEPS: SERIAL_ECHO(st.microsteps()); break; case TMC_MICROSTEPS: SERIAL_ECHO(st.microsteps()); break;
//case TMC_OTPW: serialprint_truefalse(st.otpw()); break; //case TMC_OTPW: serialprint_truefalse(st.otpw()); break;
//case TMC_OTPW_TRIGGERED: serialprint_truefalse(st.getOTPW()); break; //case TMC_OTPW_TRIGGERED: serialprint_truefalse(st.getOTPW()); break;
@ -1208,7 +1208,7 @@ static bool test_connection(TMC &st) {
case 1: stat = PSTR("HIGH"); break; case 1: stat = PSTR("HIGH"); break;
case 2: stat = PSTR("LOW"); break; case 2: stat = PSTR("LOW"); break;
} }
serialprintPGM(stat); SERIAL_ECHOPGM_P(stat);
SERIAL_EOL(); SERIAL_EOL();
return test_result; return test_result;

View file

@ -83,7 +83,7 @@ void TWIBus::send() {
// static // static
void TWIBus::echoprefix(uint8_t bytes, const char pref[], uint8_t adr) { void TWIBus::echoprefix(uint8_t bytes, const char pref[], uint8_t adr) {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
serialprintPGM(pref); SERIAL_ECHOPGM_P(pref);
SERIAL_ECHOPAIR(": from:", adr, " bytes:", bytes, " data:"); SERIAL_ECHOPAIR(": from:", adr, " bytes:", bytes, " data:");
} }
@ -172,7 +172,7 @@ void TWIBus::flush() {
// static // static
void TWIBus::prefix(const char func[]) { void TWIBus::prefix(const char func[]) {
SERIAL_ECHOPGM("TWIBus::"); SERIAL_ECHOPGM("TWIBus::");
serialprintPGM(func); SERIAL_ECHOPGM_P(func);
SERIAL_ECHOPGM(": "); SERIAL_ECHOPGM(": ");
} }
void TWIBus::debug(const char func[], uint32_t adr) { void TWIBus::debug(const char func[], uint32_t adr) {

View file

@ -114,7 +114,7 @@ void GcodeSuite::G35() {
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING)) {
DEBUG_ECHOPAIR("Probing point ", i, " ("); DEBUG_ECHOPAIR("Probing point ", i, " (");
DEBUG_PRINT_P((char *)pgm_read_ptr(&tramming_point_name[i])); DEBUG_ECHOPGM_P((char *)pgm_read_ptr(&tramming_point_name[i]));
DEBUG_CHAR(')'); DEBUG_CHAR(')');
DEBUG_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y, SP_Z_STR, z_probed_height); DEBUG_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y, SP_Z_STR, z_probed_height);
} }

View file

@ -786,7 +786,7 @@ G29_TYPE GcodeSuite::G29() {
float min_diff = 999; float min_diff = 999;
auto print_topo_map = [&](PGM_P const title, const bool get_min) { auto print_topo_map = [&](PGM_P const title, const bool get_min) {
serialprintPGM(title); SERIAL_ECHOPGM_P(title);
for (int8_t yy = abl_grid_points.y - 1; yy >= 0; yy--) { for (int8_t yy = abl_grid_points.y - 1; yy >= 0; yy--) {
LOOP_L_N(xx, abl_grid_points.x) { LOOP_L_N(xx, abl_grid_points.x) {
const int ind = indexIntoAB[xx][yy]; const int ind = indexIntoAB[xx][yy];

View file

@ -259,7 +259,7 @@ void GcodeSuite::G28() {
#if HAS_HOMING_CURRENT #if HAS_HOMING_CURRENT
auto debug_current = [](PGM_P const s, const int16_t a, const int16_t b){ auto debug_current = [](PGM_P const s, const int16_t a, const int16_t b){
serialprintPGM(s); DEBUG_ECHOLNPAIR(" current: ", a, " -> ", b); DEBUG_ECHOPGM_P(s); DEBUG_ECHOLNPAIR(" current: ", a, " -> ", b);
}; };
#if HAS_CURRENT_HOME(X) #if HAS_CURRENT_HOME(X)
const int16_t tmc_save_current_X = stepperX.getMilliamps(); const int16_t tmc_save_current_X = stepperX.getMilliamps();

View file

@ -93,7 +93,7 @@ void ac_cleanup(TERN_(HAS_MULTI_HOTEND, const uint8_t old_tool_index)) {
void print_signed_float(PGM_P const prefix, const float &f) { void print_signed_float(PGM_P const prefix, const float &f) {
SERIAL_ECHOPGM(" "); SERIAL_ECHOPGM(" ");
serialprintPGM(prefix); SERIAL_ECHOPGM_P(prefix);
SERIAL_CHAR(':'); SERIAL_CHAR(':');
if (f >= 0) SERIAL_CHAR('+'); if (f >= 0) SERIAL_CHAR('+');
SERIAL_ECHO_F(f, 2); SERIAL_ECHO_F(f, 2);
@ -449,7 +449,7 @@ void GcodeSuite::G33() {
// Report settings // Report settings
PGM_P const checkingac = PSTR("Checking... AC"); PGM_P const checkingac = PSTR("Checking... AC");
serialprintPGM(checkingac); SERIAL_ECHOPGM_P(checkingac);
if (verbose_level == 0) SERIAL_ECHOPGM(" (DRY-RUN)"); if (verbose_level == 0) SERIAL_ECHOPGM(" (DRY-RUN)");
SERIAL_EOL(); SERIAL_EOL();
ui.set_status_P(checkingac); ui.set_status_P(checkingac);
@ -625,7 +625,7 @@ void GcodeSuite::G33() {
} }
else { // dry run else { // dry run
PGM_P const enddryrun = PSTR("End DRY-RUN"); PGM_P const enddryrun = PSTR("End DRY-RUN");
serialprintPGM(enddryrun); SERIAL_ECHOPGM_P(enddryrun);
SERIAL_ECHO_SP(35); SERIAL_ECHO_SP(35);
SERIAL_ECHOLNPAIR_F("std dev:", zero_std_dev, 3); SERIAL_ECHOLNPAIR_F("std dev:", zero_std_dev, 3);

View file

@ -93,7 +93,7 @@ void GcodeSuite::M852() {
if (!ijk) { if (!ijk) {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
serialprintPGM(GET_TEXT(MSG_SKEW_FACTOR)); SERIAL_ECHOPGM_P(GET_TEXT(MSG_SKEW_FACTOR));
SERIAL_ECHOPAIR_F(" XY: ", planner.skew_factor.xy, 6); SERIAL_ECHOPAIR_F(" XY: ", planner.skew_factor.xy, 6);
#if ENABLED(SKEW_CORRECTION_FOR_Z) #if ENABLED(SKEW_CORRECTION_FOR_Z)
SERIAL_ECHOPAIR_F(" XZ: ", planner.skew_factor.xz, 6); SERIAL_ECHOPAIR_F(" XZ: ", planner.skew_factor.xz, 6);

View file

@ -36,7 +36,7 @@
void M217_report(const bool eeprom=false) { void M217_report(const bool eeprom=false) {
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP) #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
serialprintPGM(eeprom ? PSTR(" M217") : PSTR("Toolchange:")); SERIAL_ECHOPGM_P(eeprom ? PSTR(" M217") : PSTR("Toolchange:"));
SERIAL_ECHOPAIR(" S", LINEAR_UNIT(toolchange_settings.swap_length)); SERIAL_ECHOPAIR(" S", LINEAR_UNIT(toolchange_settings.swap_length));
SERIAL_ECHOPAIR_P(SP_B_STR, LINEAR_UNIT(toolchange_settings.extra_resume), SERIAL_ECHOPAIR_P(SP_B_STR, LINEAR_UNIT(toolchange_settings.extra_resume),
SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime), SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime),

View file

@ -55,7 +55,7 @@ void GcodeSuite::M302() {
// Report current state // Report current state
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPGM("Cold extrudes are "); SERIAL_ECHOPGM("Cold extrudes are ");
serialprintPGM(thermalManager.allow_cold_extrude ? PSTR("en") : PSTR("dis")); SERIAL_ECHOPGM_P(thermalManager.allow_cold_extrude ? PSTR("en") : PSTR("dis"));
SERIAL_ECHOLNPAIR("abled (min temp ", thermalManager.extrude_min_temp, "C)"); SERIAL_ECHOLNPAIR("abled (min temp ", thermalManager.extrude_min_temp, "C)");
} }
} }

View file

@ -303,7 +303,7 @@ void GcodeSuite::M43() {
if (parser.seen('E')) { if (parser.seen('E')) {
endstops.monitor_flag = parser.value_bool(); endstops.monitor_flag = parser.value_bool();
SERIAL_ECHOPGM("endstop monitor "); SERIAL_ECHOPGM("endstop monitor ");
serialprintPGM(endstops.monitor_flag ? PSTR("en") : PSTR("dis")); SERIAL_ECHOPGM_P(endstops.monitor_flag ? PSTR("en") : PSTR("dis"));
SERIAL_ECHOLNPGM("abled"); SERIAL_ECHOLNPGM("abled");
return; return;
} }

View file

@ -49,7 +49,7 @@ void GcodeSuite::M111() {
LOOP_L_N(i, COUNT(debug_strings)) { LOOP_L_N(i, COUNT(debug_strings)) {
if (TEST(marlin_debug_flags, i)) { if (TEST(marlin_debug_flags, i)) {
if (comma++) SERIAL_CHAR(','); if (comma++) SERIAL_CHAR(',');
serialprintPGM((char*)pgm_read_ptr(&debug_strings[i])); SERIAL_ECHOPGM_P((char*)pgm_read_ptr(&debug_strings[i]));
} }
} }
} }

View file

@ -56,7 +56,7 @@
// S: Report the current power supply state and exit // S: Report the current power supply state and exit
if (parser.seen('S')) { if (parser.seen('S')) {
serialprintPGM(powersupply_on ? PSTR("PS:1\n") : PSTR("PS:0\n")); SERIAL_ECHOPGM_P(powersupply_on ? PSTR("PS:1\n") : PSTR("PS:0\n"));
return; return;
} }

View file

@ -41,16 +41,16 @@ inline void L6470_say_status(const L64XX_axis_t axis) {
SERIAL_ECHO(temp_buf); SERIAL_ECHO(temp_buf);
print_bin(sh.STATUS_AXIS_RAW); print_bin(sh.STATUS_AXIS_RAW);
switch (sh.STATUS_AXIS_LAYOUT) { switch (sh.STATUS_AXIS_LAYOUT) {
case L6470_STATUS_LAYOUT: serialprintPGM(PSTR(" L6470")); break; case L6470_STATUS_LAYOUT: SERIAL_ECHOPGM(" L6470"); break;
case L6474_STATUS_LAYOUT: serialprintPGM(PSTR(" L6474")); break; case L6474_STATUS_LAYOUT: SERIAL_ECHOPGM(" L6474"); break;
case L6480_STATUS_LAYOUT: serialprintPGM(PSTR(" L6480/powerSTEP01")); break; case L6480_STATUS_LAYOUT: SERIAL_ECHOPGM(" L6480/powerSTEP01"); break;
} }
#endif #endif
SERIAL_ECHOPGM("\n...OUTPUT: "); SERIAL_ECHOPGM("\n...OUTPUT: ");
serialprintPGM(sh.STATUS_AXIS & STATUS_HIZ ? PSTR("OFF") : PSTR("ON ")); SERIAL_ECHOPGM_P(sh.STATUS_AXIS & STATUS_HIZ ? PSTR("OFF") : PSTR("ON "));
SERIAL_ECHOPGM(" BUSY: "); echo_yes_no((sh.STATUS_AXIS & STATUS_BUSY) == 0); SERIAL_ECHOPGM(" BUSY: "); echo_yes_no((sh.STATUS_AXIS & STATUS_BUSY) == 0);
SERIAL_ECHOPGM(" DIR: "); SERIAL_ECHOPGM(" DIR: ");
serialprintPGM((((sh.STATUS_AXIS & STATUS_DIR) >> 4) ^ L64xxManager.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); SERIAL_ECHOPGM_P((((sh.STATUS_AXIS & STATUS_DIR) >> 4) ^ L64xxManager.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE"));
if (sh.STATUS_AXIS_LAYOUT == L6480_STATUS_LAYOUT) { if (sh.STATUS_AXIS_LAYOUT == L6480_STATUS_LAYOUT) {
SERIAL_ECHOPGM(" Last Command: "); SERIAL_ECHOPGM(" Last Command: ");
if (sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("VALID"); if (sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("VALID");
@ -67,7 +67,7 @@ inline void L6470_say_status(const L64XX_axis_t axis) {
SERIAL_ECHOPGM(" Last Command: "); SERIAL_ECHOPGM(" Last Command: ");
if (!(sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD)) SERIAL_ECHOPGM("IN"); if (!(sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD)) SERIAL_ECHOPGM("IN");
SERIAL_ECHOPGM("VALID "); SERIAL_ECHOPGM("VALID ");
serialprintPGM(sh.STATUS_AXIS & sh.STATUS_AXIS_NOTPERF_CMD ? PSTR("COMPLETED ") : PSTR("Not PERFORMED")); SERIAL_ECHOPGM_P(sh.STATUS_AXIS & sh.STATUS_AXIS_NOTPERF_CMD ? PSTR("COMPLETED ") : PSTR("Not PERFORMED"));
SERIAL_ECHOPAIR("\n...THERMAL: ", !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_SD) ? "SHUTDOWN " : !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_WRN) ? "WARNING " : "OK "); SERIAL_ECHOPAIR("\n...THERMAL: ", !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_SD) ? "SHUTDOWN " : !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_WRN) ? "WARNING " : "OK ");
} }
SERIAL_ECHOPGM(" OVERCURRENT:"); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_OCD) == 0); SERIAL_ECHOPGM(" OVERCURRENT:"); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_OCD) == 0);

View file

@ -132,7 +132,7 @@ void L64XX_report_current(L64XX &motor, const L64XX_axis_t axis) {
SERIAL_ECHOPAIR("...MicroSteps: ", MicroSteps, SERIAL_ECHOPAIR("...MicroSteps: ", MicroSteps,
" ADC_OUT: ", L6470_ADC_out); " ADC_OUT: ", L6470_ADC_out);
SERIAL_ECHOPGM(" Vs_compensation: "); SERIAL_ECHOPGM(" Vs_compensation: ");
serialprintPGM((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_EN_VSCOMP) ? PSTR("ENABLED ") : PSTR("DISABLED")); SERIAL_ECHOPGM_P((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_EN_VSCOMP) ? PSTR("ENABLED ") : PSTR("DISABLED"));
SERIAL_ECHOLNPAIR(" Compensation coefficient: ~", comp_coef * 0.01f); SERIAL_ECHOLNPAIR(" Compensation coefficient: ~", comp_coef * 0.01f);
SERIAL_ECHOPAIR("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD), SERIAL_ECHOPAIR("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD),

View file

@ -40,7 +40,7 @@ void menu_job_recovery();
inline void plr_error(PGM_P const prefix) { inline void plr_error(PGM_P const prefix) {
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY) #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
DEBUG_ECHO_START(); DEBUG_ECHO_START();
serialprintPGM(prefix); DEBUG_ECHOPGM_P(prefix);
DEBUG_ECHOLNPGM(" Job Recovery Data"); DEBUG_ECHOLNPGM(" Job Recovery Data");
#else #else
UNUSED(prefix); UNUSED(prefix);

View file

@ -54,8 +54,8 @@ void GcodeSuite::M413() {
#if PIN_EXISTS(POWER_LOSS) #if PIN_EXISTS(POWER_LOSS)
if (parser.seen('O')) recovery._outage(); if (parser.seen('O')) recovery._outage();
#endif #endif
if (parser.seen('E')) serialprintPGM(recovery.exists() ? PSTR("PLR Exists\n") : PSTR("No PLR\n")); if (parser.seen('E')) SERIAL_ECHOPGM_P(recovery.exists() ? PSTR("PLR Exists\n") : PSTR("No PLR\n"));
if (parser.seen('V')) serialprintPGM(recovery.valid() ? PSTR("Valid\n") : PSTR("Invalid\n")); if (parser.seen('V')) SERIAL_ECHOPGM_P(recovery.valid() ? PSTR("Valid\n") : PSTR("Invalid\n"));
#endif #endif
} }

View file

@ -32,8 +32,7 @@ template<typename TMC>
void tmc_say_stealth_status(TMC &st) { void tmc_say_stealth_status(TMC &st) {
st.printLabel(); st.printLabel();
SERIAL_ECHOPGM(" driver mode:\t"); SERIAL_ECHOPGM(" driver mode:\t");
serialprintPGM(st.get_stealthChop() ? PSTR("stealthChop") : PSTR("spreadCycle")); SERIAL_ECHOLNPGM_P(st.get_stealthChop() ? PSTR("stealthChop") : PSTR("spreadCycle"));
SERIAL_EOL();
} }
template<typename TMC> template<typename TMC>
void tmc_set_stealthChop(TMC &st, const bool enable) { void tmc_set_stealthChop(TMC &st, const bool enable) {

View file

@ -29,7 +29,7 @@
inline void report_workspace_plane() { inline void report_workspace_plane() {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPGM("Workspace Plane "); SERIAL_ECHOPGM("Workspace Plane ");
serialprintPGM( SERIAL_ECHOPGM_P(
gcode.workspace_plane == GcodeSuite::PLANE_YZ ? PSTR("YZ\n") gcode.workspace_plane == GcodeSuite::PLANE_YZ ? PSTR("YZ\n")
: gcode.workspace_plane == GcodeSuite::PLANE_ZX ? PSTR("ZX\n") : gcode.workspace_plane == GcodeSuite::PLANE_ZX ? PSTR("ZX\n")
: PSTR("XY\n") : PSTR("XY\n")

View file

@ -34,8 +34,8 @@
#if ENABLED(EXTENDED_CAPABILITIES_REPORT) #if ENABLED(EXTENDED_CAPABILITIES_REPORT)
static void cap_line(PGM_P const name, bool ena=false) { static void cap_line(PGM_P const name, bool ena=false) {
SERIAL_ECHOPGM("Cap:"); SERIAL_ECHOPGM("Cap:");
serialprintPGM(name); SERIAL_ECHOPGM_P(name);
SERIAL_CHAR(':', ena ? '1' : '0'); SERIAL_CHAR(':', '0' + ena);
SERIAL_EOL(); SERIAL_EOL();
} }
#endif #endif

View file

@ -34,10 +34,9 @@
static void config_prefix(PGM_P const name, PGM_P const pref=nullptr, const int8_t ind=-1) { static void config_prefix(PGM_P const name, PGM_P const pref=nullptr, const int8_t ind=-1) {
SERIAL_ECHOPGM("Config:"); SERIAL_ECHOPGM("Config:");
if (pref) serialprintPGM(pref); if (pref) SERIAL_ECHOPGM_P(pref);
if (ind >= 0) { SERIAL_ECHO(ind); SERIAL_CHAR(':'); } if (ind >= 0) { SERIAL_ECHO(ind); SERIAL_CHAR(':'); }
serialprintPGM(name); SERIAL_ECHOPAIR_P(name, AS_CHAR(':'));
SERIAL_CHAR(':');
} }
static void config_line(PGM_P const name, const float val, PGM_P const pref=nullptr, const int8_t ind=-1) { static void config_line(PGM_P const name, const float val, PGM_P const pref=nullptr, const int8_t ind=-1) {
config_prefix(name, pref, ind); config_prefix(name, pref, ind);

View file

@ -304,8 +304,7 @@ inline int read_serial(const uint8_t index) { return SERIAL_IMPL.read(index); }
void GCodeQueue::gcode_line_error(PGM_P const err, const serial_index_t serial_ind) { void GCodeQueue::gcode_line_error(PGM_P const err, const serial_index_t serial_ind) {
PORT_REDIRECT(SERIAL_PORTMASK(serial_ind)); // Reply to the serial port that sent the command PORT_REDIRECT(SERIAL_PORTMASK(serial_ind)); // Reply to the serial port that sent the command
SERIAL_ERROR_START(); SERIAL_ERROR_START();
SERIAL_ECHOPGM_P(err); SERIAL_ECHOLNPAIR_P(err, serial_state[serial_ind].last_N);
SERIAL_ECHOLN(serial_state[serial_ind].last_N);
while (read_serial(serial_ind) != -1) { /* nada */ } // Clear out the RX buffer. Why don't use flush here ? while (read_serial(serial_ind) != -1) { /* nada */ } // Clear out the RX buffer. Why don't use flush here ?
flush_and_request_resend(); flush_and_request_resend();
serial_state[serial_ind].count = 0; serial_state[serial_ind].count = 0;

View file

@ -290,7 +290,7 @@ namespace Anycubic {
void ChironTFT::SendtoTFT(PGM_P str) { // A helper to print PROGMEN string to the panel void ChironTFT::SendtoTFT(PGM_P str) { // A helper to print PROGMEN string to the panel
#if ACDEBUG(AC_SOME) #if ACDEBUG(AC_SOME)
serialprintPGM(str); SERIAL_ECHOPGM_P(str);
#endif #endif
while (const char c = pgm_read_byte(str++)) TFTSer.write(c); while (const char c = pgm_read_byte(str++)) TFTSer.write(c);
} }

View file

@ -37,8 +37,6 @@ L64XX_Marlin L64xxManager;
#include "../../module/planner.h" #include "../../module/planner.h"
#include "../../HAL/shared/Delay.h" #include "../../HAL/shared/Delay.h"
void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); }
static const char str_X[] PROGMEM = "X ", str_Y[] PROGMEM = "Y ", str_Z[] PROGMEM = "Z ", static const char str_X[] PROGMEM = "X ", str_Y[] PROGMEM = "Y ", str_Z[] PROGMEM = "Z ",
str_X2[] PROGMEM = "X2", str_Y2[] PROGMEM = "Y2", str_X2[] PROGMEM = "X2", str_Y2[] PROGMEM = "Y2",
str_Z2[] PROGMEM = "Z2", str_Z3[] PROGMEM = "Z3", str_Z4[] PROGMEM = "Z4", str_Z2[] PROGMEM = "Z2", str_Z3[] PROGMEM = "Z3", str_Z4[] PROGMEM = "Z4",
@ -56,6 +54,8 @@ PGM_P const L64XX_Marlin::index_to_axis[] PROGMEM = {
#define DEBUG_OUT ENABLED(L6470_CHITCHAT) #define DEBUG_OUT ENABLED(L6470_CHITCHAT)
#include "../../core/debug_out.h" #include "../../core/debug_out.h"
void echo_yes_no(const bool yes) { DEBUG_ECHOPGM_P(yes ? PSTR(" YES") : PSTR(" NO ")); UNUSED(yes); }
uint8_t L64XX_Marlin::dir_commands[MAX_L64XX]; // array to hold direction command for each driver uint8_t L64XX_Marlin::dir_commands[MAX_L64XX]; // array to hold direction command for each driver
const uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = { const uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = {
@ -375,7 +375,7 @@ inline void echo_min_max(const char a, const float &min, const float &max) {
} }
inline void echo_oct_used(const float &oct, const uint8_t stall) { inline void echo_oct_used(const float &oct, const uint8_t stall) {
DEBUG_ECHOPAIR("over_current_threshold used : ", oct); DEBUG_ECHOPAIR("over_current_threshold used : ", oct);
serialprintPGM(stall ? PSTR(" (Stall") : PSTR(" (OCD")); DEBUG_ECHOPGM_P(stall ? PSTR(" (Stall") : PSTR(" (OCD"));
DEBUG_ECHOLNPGM(" threshold)"); DEBUG_ECHOLNPGM(" threshold)");
} }
inline void err_out_of_bounds() { DEBUG_ECHOLNPGM("Test aborted - motion out of bounds"); } inline void err_out_of_bounds() { DEBUG_ECHOLNPGM("Test aborted - motion out of bounds"); }
@ -652,7 +652,7 @@ void L64XX_Marlin::say_axis(const L64XX_axis_t axis, const uint8_t label/*=true*
) { ) {
say_axis(axis); say_axis(axis);
DEBUG_ECHOPGM(" THERMAL: "); DEBUG_ECHOPGM(" THERMAL: ");
serialprintPGM((status & _status_axis_th_sd) ? PSTR("SHUTDOWN") : (status & _status_axis_th_wrn) ? PSTR("WARNING ") : PSTR("OK ")); DEBUG_ECHOPGM_P((status & _status_axis_th_sd) ? PSTR("SHUTDOWN") : (status & _status_axis_th_wrn) ? PSTR("WARNING ") : PSTR("OK "));
DEBUG_ECHOPGM(" OVERCURRENT: "); DEBUG_ECHOPGM(" OVERCURRENT: ");
echo_yes_no((status & _status_axis_ocd) != 0); echo_yes_no((status & _status_axis_ocd) != 0);
if (!(_status_axis_layout == L6474_STATUS_LAYOUT)) { // L6474 doesn't have these bits if (!(_status_axis_layout == L6474_STATUS_LAYOUT)) { // L6474 doesn't have these bits

View file

@ -98,7 +98,7 @@ millis_t Stopwatch::duration() {
void Stopwatch::debug(const char func[]) { void Stopwatch::debug(const char func[]) {
if (DEBUGGING(INFO)) { if (DEBUGGING(INFO)) {
SERIAL_ECHOPGM("Stopwatch::"); SERIAL_ECHOPGM("Stopwatch::");
serialprintPGM(func); SERIAL_ECHOPGM_P(func);
SERIAL_ECHOLNPGM("()"); SERIAL_ECHOLNPGM("()");
} }
} }

View file

@ -77,7 +77,7 @@ void vector_3::apply_rotation(const matrix_3x3 &matrix) {
} }
void vector_3::debug(PGM_P const title) { void vector_3::debug(PGM_P const title) {
serialprintPGM(title); SERIAL_ECHOPGM_P(title);
SERIAL_ECHOPAIR_F_P(SP_X_STR, x, 6); SERIAL_ECHOPAIR_F_P(SP_X_STR, x, 6);
SERIAL_ECHOPAIR_F_P(SP_Y_STR, y, 6); SERIAL_ECHOPAIR_F_P(SP_Y_STR, y, 6);
SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, z, 6); SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, z, 6);
@ -139,10 +139,7 @@ matrix_3x3 matrix_3x3::transpose(const matrix_3x3 &original) {
} }
void matrix_3x3::debug(PGM_P const title) { void matrix_3x3::debug(PGM_P const title) {
if (title) { if (title) SERIAL_ECHOLNPGM_P(title);
serialprintPGM(title);
SERIAL_EOL();
}
LOOP_L_N(i, 3) { LOOP_L_N(i, 3) {
LOOP_L_N(j, 3) { LOOP_L_N(j, 3) {
if (vectors[i][j] >= 0.0) SERIAL_CHAR('+'); if (vectors[i][j] >= 0.0) SERIAL_CHAR('+');

View file

@ -405,10 +405,9 @@ void Endstops::event_handler() {
} }
static void print_es_state(const bool is_hit, PGM_P const label=nullptr) { static void print_es_state(const bool is_hit, PGM_P const label=nullptr) {
if (label) serialprintPGM(label); if (label) SERIAL_ECHOPGM_P(label);
SERIAL_ECHOPGM(": "); SERIAL_ECHOPGM(": ");
serialprintPGM(is_hit ? PSTR(STR_ENDSTOP_HIT) : PSTR(STR_ENDSTOP_OPEN)); SERIAL_ECHOLNPGM_P(is_hit ? PSTR(STR_ENDSTOP_HIT) : PSTR(STR_ENDSTOP_OPEN));
SERIAL_EOL();
} }
void _O2 Endstops::report_states() { void _O2 Endstops::report_states() {

View file

@ -2973,7 +2973,7 @@ inline void limit_and_warn(float &val, const uint8_t axis, PGM_P const setting_n
if (before != val) { if (before != val) {
SERIAL_CHAR(axis_codes[lim_axis]); SERIAL_CHAR(axis_codes[lim_axis]);
SERIAL_ECHOPGM(" Max "); SERIAL_ECHOPGM(" Max ");
serialprintPGM(setting_name); SERIAL_ECHOPGM_P(setting_name);
SERIAL_ECHOLNPAIR(" limited to ", val); SERIAL_ECHOLNPAIR(" limited to ", val);
} }
} }

View file

@ -118,7 +118,7 @@ void PrintCounter::initStats() {
inline bool _service_warn(const char * const msg) { inline bool _service_warn(const char * const msg) {
_print_divider(); _print_divider();
SERIAL_ECHO_START(); SERIAL_ECHO_START();
serialprintPGM(msg); SERIAL_ECHOPGM_P(msg);
SERIAL_ECHOLNPGM("!"); SERIAL_ECHOLNPGM("!");
_print_divider(); _print_divider();
return true; return true;
@ -177,7 +177,7 @@ void PrintCounter::saveStats() {
#if HAS_SERVICE_INTERVALS #if HAS_SERVICE_INTERVALS
inline void _service_when(char buffer[], const char * const msg, const uint32_t when) { inline void _service_when(char buffer[], const char * const msg, const uint32_t when) {
SERIAL_ECHOPGM(STR_STATS); SERIAL_ECHOPGM(STR_STATS);
serialprintPGM(msg); SERIAL_ECHOPGM_P(msg);
SERIAL_ECHOLNPAIR(" in ", duration_t(when).toString(buffer)); SERIAL_ECHOLNPAIR(" in ", duration_t(when).toString(buffer));
} }
#endif #endif
@ -339,7 +339,7 @@ void PrintCounter::reset() {
void PrintCounter::debug(const char func[]) { void PrintCounter::debug(const char func[]) {
if (DEBUGGING(INFO)) { if (DEBUGGING(INFO)) {
SERIAL_ECHOPGM("PrintCounter::"); SERIAL_ECHOPGM("PrintCounter::");
serialprintPGM(func); SERIAL_ECHOPGM_P(func);
SERIAL_ECHOLNPGM("()"); SERIAL_ECHOLNPGM("()");
} }
} }

View file

@ -279,8 +279,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
PGM_P const ds_str = deploy ? GET_TEXT(MSG_MANUAL_DEPLOY) : GET_TEXT(MSG_MANUAL_STOW); PGM_P const ds_str = deploy ? GET_TEXT(MSG_MANUAL_DEPLOY) : GET_TEXT(MSG_MANUAL_STOW);
ui.return_to_status(); // To display the new status message ui.return_to_status(); // To display the new status message
ui.set_status_P(ds_str, 99); ui.set_status_P(ds_str, 99);
serialprintPGM(ds_str); SERIAL_ECHOLNPGM_P(ds_str);
SERIAL_EOL();
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), CONTINUE_STR)); TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), CONTINUE_STR));
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Stow Probe"))); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Stow Probe")));
@ -586,7 +585,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
early_fail = (scheck && current_position.z > -offset.z + clearance); // Probe triggered too high? early_fail = (scheck && current_position.z > -offset.z + clearance); // Probe triggered too high?
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING) && (probe_fail || early_fail)) { if (DEBUGGING(LEVELING) && (probe_fail || early_fail)) {
DEBUG_PRINT_P(plbl); DEBUG_ECHOPGM_P(plbl);
DEBUG_ECHOPGM(" Probe fail! -"); DEBUG_ECHOPGM(" Probe fail! -");
if (probe_fail) DEBUG_ECHOPGM(" No trigger."); if (probe_fail) DEBUG_ECHOPGM(" No trigger.");
if (early_fail) DEBUG_ECHOPGM(" Triggered early."); if (early_fail) DEBUG_ECHOPGM(" Triggered early.");

View file

@ -2990,7 +2990,7 @@ void MarlinSettings::reset() {
if (!repl) { if (!repl) {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPGM("; "); SERIAL_ECHOPGM("; ");
serialprintPGM(pstr); SERIAL_ECHOPGM_P(pstr);
if (eol) SERIAL_EOL(); if (eol) SERIAL_EOL();
} }
} }
@ -3007,7 +3007,7 @@ void MarlinSettings::reset() {
SERIAL_ECHOPGM(" M569 S1"); SERIAL_ECHOPGM(" M569 S1");
if (etc) { if (etc) {
SERIAL_CHAR(' '); SERIAL_CHAR(' ');
serialprintPGM(etc); SERIAL_ECHOPGM_P(etc);
} }
if (newLine) SERIAL_EOL(); if (newLine) SERIAL_EOL();
} }
@ -3025,7 +3025,7 @@ void MarlinSettings::reset() {
#endif #endif
inline void say_units(const bool colon) { inline void say_units(const bool colon) {
serialprintPGM( SERIAL_ECHOPGM_P(
#if ENABLED(INCH_MODE_SUPPORT) #if ENABLED(INCH_MODE_SUPPORT)
parser.linear_unit_factor != 1.0 ? PSTR(" (in)") : parser.linear_unit_factor != 1.0 ? PSTR(" (in)") :
#endif #endif
@ -3066,7 +3066,7 @@ void MarlinSettings::reset() {
SERIAL_ECHOPGM(" M149 "); SERIAL_ECHOPGM(" M149 ");
SERIAL_CHAR(parser.temp_units_code()); SERIAL_CHAR(parser.temp_units_code());
SERIAL_ECHOPGM(" ; Units in "); SERIAL_ECHOPGM(" ; Units in ");
serialprintPGM(parser.temp_units_name()); SERIAL_ECHOPGM_P(parser.temp_units_name());
#else #else
SERIAL_ECHOLNPGM(" M149 C ; Units in Celsius"); SERIAL_ECHOLNPGM(" M149 C ; Units in Celsius");
#endif #endif
@ -3254,12 +3254,12 @@ void MarlinSettings::reset() {
LOOP_L_N(py, GRID_MAX_POINTS_Y) { LOOP_L_N(py, GRID_MAX_POINTS_Y) {
LOOP_L_N(px, GRID_MAX_POINTS_X) { LOOP_L_N(px, GRID_MAX_POINTS_X) {
CONFIG_ECHO_START(); CONFIG_ECHO_START();
SERIAL_ECHOPAIR_P(PSTR(" G29 S3 I"), px, PSTR(" J"), py); SERIAL_ECHOPAIR(" G29 S3 I", px, " J", py);
SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(mbl.z_values[px][py]), 5); SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(mbl.z_values[px][py]), 5);
} }
} }
CONFIG_ECHO_START(); CONFIG_ECHO_START();
SERIAL_ECHOLNPAIR_F_P(PSTR(" G29 S4 Z"), LINEAR_UNIT(mbl.z_offset), 5); SERIAL_ECHOLNPAIR_F(" G29 S4 Z", LINEAR_UNIT(mbl.z_offset), 5);
} }
#elif ENABLED(AUTO_BED_LEVELING_UBL) #elif ENABLED(AUTO_BED_LEVELING_UBL)

View file

@ -664,9 +664,9 @@ volatile bool Temperature::raw_temps_ready = false;
#if EITHER(PIDTEMPBED, PIDTEMPCHAMBER) #if EITHER(PIDTEMPBED, PIDTEMPCHAMBER)
PGM_P const estring = GHV(PSTR("chamber"), PSTR("bed"), NUL_STR); PGM_P const estring = GHV(PSTR("chamber"), PSTR("bed"), NUL_STR);
say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp); say_default_(); SERIAL_ECHOPGM_P(estring); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp);
say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki); say_default_(); SERIAL_ECHOPGM_P(estring); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki);
say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Kd ", tune_pid.Kd); say_default_(); SERIAL_ECHOPGM_P(estring); SERIAL_ECHOLNPAIR("Kd ", tune_pid.Kd);
#else #else
say_default_(); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp); say_default_(); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp);
say_default_(); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki); say_default_(); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki);
@ -868,7 +868,7 @@ void Temperature::_temp_error(const heater_id_t heater_id, PGM_P const serial_ms
if (IsRunning() && TERN1(BOGUS_TEMPERATURE_GRACE_PERIOD, killed == 2)) { if (IsRunning() && TERN1(BOGUS_TEMPERATURE_GRACE_PERIOD, killed == 2)) {
SERIAL_ERROR_START(); SERIAL_ERROR_START();
serialprintPGM(serial_msg); SERIAL_ECHOPGM_P(serial_msg);
SERIAL_ECHOPGM(STR_STOPPED_HEATER); SERIAL_ECHOPGM(STR_STOPPED_HEATER);
if (heater_id >= 0) if (heater_id >= 0)
SERIAL_ECHO(heater_id); SERIAL_ECHO(heater_id);
@ -1532,7 +1532,7 @@ void Temperature::manage_heater() {
SERIAL_ECHOPAIR_F_P(SP_B_STR, t.beta, 1); SERIAL_ECHOPAIR_F_P(SP_B_STR, t.beta, 1);
SERIAL_ECHOPAIR_F_P(SP_C_STR, t.sh_c_coeff, 9); SERIAL_ECHOPAIR_F_P(SP_C_STR, t.sh_c_coeff, 9);
SERIAL_ECHOPGM(" ; "); SERIAL_ECHOPGM(" ; ");
serialprintPGM( SERIAL_ECHOPGM_P(
TERN_(TEMP_SENSOR_0_IS_CUSTOM, t_index == CTI_HOTEND_0 ? PSTR("HOTEND 0") :) TERN_(TEMP_SENSOR_0_IS_CUSTOM, t_index == CTI_HOTEND_0 ? PSTR("HOTEND 0") :)
TERN_(TEMP_SENSOR_1_IS_CUSTOM, t_index == CTI_HOTEND_1 ? PSTR("HOTEND 1") :) TERN_(TEMP_SENSOR_1_IS_CUSTOM, t_index == CTI_HOTEND_1 ? PSTR("HOTEND 1") :)
TERN_(TEMP_SENSOR_2_IS_CUSTOM, t_index == CTI_HOTEND_2 ? PSTR("HOTEND 2") :) TERN_(TEMP_SENSOR_2_IS_CUSTOM, t_index == CTI_HOTEND_2 ? PSTR("HOTEND 2") :)

View file

@ -238,7 +238,7 @@ const PinInfo pin_array[] PROGMEM = {
#endif #endif
static void print_input_or_output(const bool isout) { static void print_input_or_output(const bool isout) {
serialprintPGM(isout ? PSTR("Output = ") : PSTR("Input = ")); SERIAL_ECHOPGM_P(isout ? PSTR("Output = ") : PSTR("Input = "));
} }
// pretty report with PWM info // pretty report with PWM info
@ -266,8 +266,8 @@ inline void report_pin_state_extended(pin_t pin, const bool ignore, const bool e
LOOP_L_N(x, COUNT(pin_array)) { // scan entire array and report all instances of this pin LOOP_L_N(x, COUNT(pin_array)) { // scan entire array and report all instances of this pin
if (GET_ARRAY_PIN(x) == pin) { if (GET_ARRAY_PIN(x) == pin) {
if (!found) { // report digital and analog pin number only on the first time through if (!found) { // report digital and analog pin number only on the first time through
if (start_string) serialprintPGM(start_string); if (start_string) SERIAL_ECHOPGM_P(start_string);
serialprintPGM(PSTR("PIN: ")); SERIAL_ECHOPGM("PIN: ");
PRINT_PIN(pin); PRINT_PIN(pin);
PRINT_PORT(pin); PRINT_PORT(pin);
if (int8_t(DIGITAL_PIN_TO_ANALOG_PIN(pin)) >= 0) { if (int8_t(DIGITAL_PIN_TO_ANALOG_PIN(pin)) >= 0) {
@ -317,8 +317,8 @@ inline void report_pin_state_extended(pin_t pin, const bool ignore, const bool e
} // end of for loop } // end of for loop
if (!found) { if (!found) {
if (start_string) serialprintPGM(start_string); if (start_string) SERIAL_ECHOPGM_P(start_string);
serialprintPGM(PSTR("PIN: ")); SERIAL_ECHOPGM("PIN: ");
PRINT_PIN(pin); PRINT_PIN(pin);
PRINT_PORT(pin); PRINT_PORT(pin);
if (int8_t(DIGITAL_PIN_TO_ANALOG_PIN(pin)) >= 0) { if (int8_t(DIGITAL_PIN_TO_ANALOG_PIN(pin)) >= 0) {

View file

@ -552,7 +552,7 @@ void announceOpen(const uint8_t doing, const char * const path) {
PORT_REDIRECT(SERIAL_ALL); PORT_REDIRECT(SERIAL_ALL);
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPGM("Now "); SERIAL_ECHOPGM("Now ");
serialprintPGM(doing == 1 ? PSTR("doing") : PSTR("fresh")); SERIAL_ECHOPGM_P(doing == 1 ? PSTR("doing") : PSTR("fresh"));
SERIAL_ECHOLNPAIR(" file: ", path); SERIAL_ECHOLNPAIR(" file: ", path);
} }
} }
@ -1251,7 +1251,7 @@ void CardReader::fileHasFinished() {
removeFile(recovery.filename); removeFile(recovery.filename);
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY) #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
SERIAL_ECHOPGM("Power-loss file delete"); SERIAL_ECHOPGM("Power-loss file delete");
serialprintPGM(jobRecoverFileExists() ? PSTR(" failed.\n") : PSTR("d.\n")); SERIAL_ECHOPGM_P(jobRecoverFileExists() ? PSTR(" failed.\n") : PSTR("d.\n"));
#endif #endif
} }
} }