🎨 Apply F() to various reports
This commit is contained in:
@ -57,14 +57,14 @@ void MAC_report() {
|
||||
|
||||
// Display current values when the link is active,
|
||||
// otherwise show the stored values
|
||||
void ip_report(const uint16_t cmd, PGM_P const post, const IPAddress &ipo) {
|
||||
void ip_report(const uint16_t cmd, FSTR_P const post, const IPAddress &ipo) {
|
||||
SERIAL_CHAR('M'); SERIAL_ECHO(cmd); SERIAL_CHAR(' ');
|
||||
LOOP_L_N(i, 4) {
|
||||
SERIAL_ECHO(ipo[i]);
|
||||
if (i < 3) SERIAL_CHAR('.');
|
||||
}
|
||||
SERIAL_ECHOPGM(" ; ");
|
||||
SERIAL_ECHOLNPGM_P(post);
|
||||
SERIAL_ECHOLNF(post);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -98,7 +98,7 @@ void GcodeSuite::M552() {
|
||||
}
|
||||
|
||||
void GcodeSuite::M552_report() {
|
||||
ip_report(552, PSTR("ip address"), Ethernet.linkStatus() == LinkON ? Ethernet.localIP() : ethernet.ip);
|
||||
ip_report(552, F("ip address"), Ethernet.linkStatus() == LinkON ? Ethernet.localIP() : ethernet.ip);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -112,7 +112,7 @@ void GcodeSuite::M553() {
|
||||
}
|
||||
|
||||
void GcodeSuite::M553_report() {
|
||||
ip_report(553, PSTR("subnet mask"), Ethernet.linkStatus() == LinkON ? Ethernet.subnetMask() : ethernet.subnet);
|
||||
ip_report(553, F("subnet mask"), Ethernet.linkStatus() == LinkON ? Ethernet.subnetMask() : ethernet.subnet);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -126,7 +126,7 @@ void GcodeSuite::M554() {
|
||||
}
|
||||
|
||||
void GcodeSuite::M554_report() {
|
||||
ip_report(554, PSTR("gateway"), Ethernet.linkStatus() == LinkON ? Ethernet.gatewayIP() : ethernet.gateway);
|
||||
ip_report(554, F("gateway"), Ethernet.linkStatus() == LinkON ? Ethernet.gatewayIP() : ethernet.gateway);
|
||||
}
|
||||
|
||||
#endif // HAS_ETHERNET
|
||||
|
@ -44,10 +44,10 @@
|
||||
|
||||
void menu_job_recovery();
|
||||
|
||||
inline void plr_error(PGM_P const prefix) {
|
||||
inline void plr_error(FSTR_P const prefix) {
|
||||
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOPGM_P(prefix);
|
||||
DEBUG_ECHOF(prefix);
|
||||
DEBUG_ECHOLNPGM(" Job Recovery Data");
|
||||
#else
|
||||
UNUSED(prefix);
|
||||
@ -91,7 +91,7 @@ void GcodeSuite::M1000() {
|
||||
recovery.resume();
|
||||
}
|
||||
else
|
||||
plr_error(recovery.info.valid_head ? PSTR("No") : PSTR("Invalid"));
|
||||
plr_error(recovery.info.valid_head ? F("No") : F("Invalid"));
|
||||
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ void GcodeSuite::M413() {
|
||||
if (parser.seen("RL")) recovery.load();
|
||||
if (parser.seen_test('W')) recovery.save(true);
|
||||
if (parser.seen_test('P')) recovery.purge();
|
||||
if (parser.seen_test('D')) recovery.debug(PSTR("M413"));
|
||||
if (parser.seen_test('D')) recovery.debug(F("M413"));
|
||||
#if PIN_EXISTS(POWER_LOSS)
|
||||
if (parser.seen_test('O')) recovery._outage();
|
||||
#endif
|
||||
|
@ -141,12 +141,12 @@ void GcodeSuite::M569() {
|
||||
void GcodeSuite::M569_report(const bool forReplay/*=true*/) {
|
||||
report_heading(forReplay, F(STR_DRIVER_STEPPING_MODE));
|
||||
|
||||
auto say_M569 = [](const bool forReplay, const char * const etc=nullptr, const bool eol=false) {
|
||||
auto say_M569 = [](const bool forReplay, FSTR_P const etc=nullptr, const bool eol=false) {
|
||||
if (!forReplay) SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM(" M569 S1");
|
||||
if (etc) {
|
||||
SERIAL_CHAR(' ');
|
||||
SERIAL_ECHOPGM_P(etc);
|
||||
SERIAL_ECHOF(etc);
|
||||
}
|
||||
if (eol) SERIAL_EOL();
|
||||
};
|
||||
@ -176,28 +176,28 @@ void GcodeSuite::M569_report(const bool forReplay/*=true*/) {
|
||||
chop_z2 = TERN0(Z2_HAS_STEALTHCHOP, stepperZ2.get_stored_stealthChop());
|
||||
|
||||
if (chop_x2 || chop_y2 || chop_z2) {
|
||||
say_M569(forReplay, PSTR("I1"));
|
||||
say_M569(forReplay, F("I1"));
|
||||
if (chop_x2) SERIAL_ECHOPGM_P(SP_X_STR);
|
||||
if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR);
|
||||
if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
if (TERN0(Z3_HAS_STEALTHCHOP, stepperZ3.get_stored_stealthChop())) { say_M569(forReplay, PSTR("I2 Z"), true); }
|
||||
if (TERN0(Z4_HAS_STEALTHCHOP, stepperZ4.get_stored_stealthChop())) { say_M569(forReplay, PSTR("I3 Z"), true); }
|
||||
if (TERN0(Z3_HAS_STEALTHCHOP, stepperZ3.get_stored_stealthChop())) { say_M569(forReplay, F("I2 Z"), true); }
|
||||
if (TERN0(Z4_HAS_STEALTHCHOP, stepperZ4.get_stored_stealthChop())) { say_M569(forReplay, F("I3 Z"), true); }
|
||||
|
||||
if (TERN0( I_HAS_STEALTHCHOP, stepperI.get_stored_stealthChop())) { say_M569(forReplay, SP_I_STR, true); }
|
||||
if (TERN0( J_HAS_STEALTHCHOP, stepperJ.get_stored_stealthChop())) { say_M569(forReplay, SP_J_STR, true); }
|
||||
if (TERN0( K_HAS_STEALTHCHOP, stepperK.get_stored_stealthChop())) { say_M569(forReplay, SP_K_STR, true); }
|
||||
if (TERN0( I_HAS_STEALTHCHOP, stepperI.get_stored_stealthChop())) { say_M569(forReplay, FPSTR(SP_I_STR), true); }
|
||||
if (TERN0( J_HAS_STEALTHCHOP, stepperJ.get_stored_stealthChop())) { say_M569(forReplay, FPSTR(SP_J_STR), true); }
|
||||
if (TERN0( K_HAS_STEALTHCHOP, stepperK.get_stored_stealthChop())) { say_M569(forReplay, FPSTR(SP_K_STR), true); }
|
||||
|
||||
if (TERN0(E0_HAS_STEALTHCHOP, stepperE0.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T0 E"), true); }
|
||||
if (TERN0(E1_HAS_STEALTHCHOP, stepperE1.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T1 E"), true); }
|
||||
if (TERN0(E2_HAS_STEALTHCHOP, stepperE2.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T2 E"), true); }
|
||||
if (TERN0(E3_HAS_STEALTHCHOP, stepperE3.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T3 E"), true); }
|
||||
if (TERN0(E4_HAS_STEALTHCHOP, stepperE4.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T4 E"), true); }
|
||||
if (TERN0(E5_HAS_STEALTHCHOP, stepperE5.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T5 E"), true); }
|
||||
if (TERN0(E6_HAS_STEALTHCHOP, stepperE6.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T6 E"), true); }
|
||||
if (TERN0(E7_HAS_STEALTHCHOP, stepperE7.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T7 E"), true); }
|
||||
if (TERN0(E0_HAS_STEALTHCHOP, stepperE0.get_stored_stealthChop())) { say_M569(forReplay, F("T0 E"), true); }
|
||||
if (TERN0(E1_HAS_STEALTHCHOP, stepperE1.get_stored_stealthChop())) { say_M569(forReplay, F("T1 E"), true); }
|
||||
if (TERN0(E2_HAS_STEALTHCHOP, stepperE2.get_stored_stealthChop())) { say_M569(forReplay, F("T2 E"), true); }
|
||||
if (TERN0(E3_HAS_STEALTHCHOP, stepperE3.get_stored_stealthChop())) { say_M569(forReplay, F("T3 E"), true); }
|
||||
if (TERN0(E4_HAS_STEALTHCHOP, stepperE4.get_stored_stealthChop())) { say_M569(forReplay, F("T4 E"), true); }
|
||||
if (TERN0(E5_HAS_STEALTHCHOP, stepperE5.get_stored_stealthChop())) { say_M569(forReplay, F("T5 E"), true); }
|
||||
if (TERN0(E6_HAS_STEALTHCHOP, stepperE6.get_stored_stealthChop())) { say_M569(forReplay, F("T6 E"), true); }
|
||||
if (TERN0(E7_HAS_STEALTHCHOP, stepperE7.get_stored_stealthChop())) { say_M569(forReplay, F("T7 E"), true); }
|
||||
}
|
||||
|
||||
#endif // HAS_STEALTHCHOP
|
||||
|
Reference in New Issue
Block a user