🎨 Apply F() to various reports

This commit is contained in:
Scott Lahteine
2021-09-27 13:46:42 -05:00
parent cabd538fdd
commit 24dbeceb45
30 changed files with 286 additions and 289 deletions

View File

@ -483,10 +483,10 @@ void Endstops::event_handler() {
#pragma GCC diagnostic ignored "-Wunused-function"
#endif
static void print_es_state(const bool is_hit, PGM_P const label=nullptr) {
if (label) SERIAL_ECHOPGM_P(label);
static void print_es_state(const bool is_hit, FSTR_P const flabel=nullptr) {
if (flabel) SERIAL_ECHOF(flabel);
SERIAL_ECHOPGM(": ");
SERIAL_ECHOLNPGM_P(is_hit ? PSTR(STR_ENDSTOP_HIT) : PSTR(STR_ENDSTOP_OPEN));
SERIAL_ECHOLNF(is_hit ? F(STR_ENDSTOP_HIT) : F(STR_ENDSTOP_OPEN));
}
#if GCC_VERSION <= 50000
@ -496,7 +496,7 @@ static void print_es_state(const bool is_hit, PGM_P const label=nullptr) {
void _O2 Endstops::report_states() {
TERN_(BLTOUCH, bltouch._set_SW_mode());
SERIAL_ECHOLNPGM(STR_M119_REPORT);
#define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, PSTR(STR_##S))
#define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, F(STR_##S))
#if HAS_X_MIN
ES_REPORT(X_MIN);
#endif
@ -564,10 +564,10 @@ void _O2 Endstops::report_states() {
ES_REPORT(K_MAX);
#endif
#if BOTH(MARLIN_DEV_MODE, PROBE_ACTIVATION_SWITCH)
print_es_state(probe_switch_activated(), PSTR(STR_PROBE_EN));
print_es_state(probe_switch_activated(), F(STR_PROBE_EN));
#endif
#if USES_Z_MIN_PROBE_PIN
print_es_state(PROBE_TRIGGERED(), PSTR(STR_Z_PROBE));
print_es_state(PROBE_TRIGGERED(), F(STR_Z_PROBE));
#endif
#if MULTI_FILAMENT_SENSOR
#define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; state = FIL_RUNOUT##N##_STATE; break;
@ -584,7 +584,7 @@ void _O2 Endstops::report_states() {
}
#undef _CASE_RUNOUT
#elif HAS_FILAMENT_SENSOR
print_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE, PSTR(STR_FILAMENT));
print_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE, F(STR_FILAMENT));
#endif
TERN_(BLTOUCH, bltouch._reset_SW_mode());