Distinct runout states (#19965)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
@ -459,18 +459,19 @@ void _O2 Endstops::report_states() {
|
||||
#endif
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
#if NUM_RUNOUT_SENSORS == 1
|
||||
print_es_state(READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE, PSTR(STR_FILAMENT_RUNOUT_SENSOR));
|
||||
print_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE, PSTR(STR_FILAMENT_RUNOUT_SENSOR));
|
||||
#else
|
||||
#define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; break;
|
||||
#define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; state = FIL_RUNOUT##N##_STATE; break;
|
||||
LOOP_S_LE_N(i, 1, NUM_RUNOUT_SENSORS) {
|
||||
pin_t pin;
|
||||
uint8_t state;
|
||||
switch (i) {
|
||||
default: continue;
|
||||
REPEAT_S(1, INCREMENT(NUM_RUNOUT_SENSORS), _CASE_RUNOUT)
|
||||
}
|
||||
SERIAL_ECHOPGM(STR_FILAMENT_RUNOUT_SENSOR);
|
||||
if (i > 1) SERIAL_CHAR(' ', '0' + i);
|
||||
print_es_state(extDigitalRead(pin) != FIL_RUNOUT_STATE);
|
||||
print_es_state(extDigitalRead(pin) != state);
|
||||
}
|
||||
#undef _CASE_RUNOUT
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user