Skip to content
Snippets Groups Projects
Commit 544b1663 authored by Scott Lahteine's avatar Scott Lahteine
Browse files

Fix poll_runout_states bug

parent a4c98146
Branches
Tags
No related merge requests found
......@@ -140,6 +140,7 @@ class FilamentSensorBase {
#define _INIT_RUNOUT(N) INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN);
REPEAT_S(1, INCREMENT(NUM_RUNOUT_SENSORS), _INIT_RUNOUT)
#undef _INIT_RUNOUT
#undef INIT_RUNOUT_PIN
}
// Return a bitmask of runout pin states
......@@ -151,10 +152,8 @@ class FilamentSensorBase {
// Return a bitmask of runout flag states (1 bits always indicates runout)
static inline uint8_t poll_runout_states() {
return poll_runout_pins() ^ uint8_t(TERN0(FIL_RUNOUT_INVERTING, _BV(NUM_RUNOUT_SENSORS) - 1));
return poll_runout_pins() ^ uint8_t(TERN(FIL_RUNOUT_INVERTING, 0, _BV(NUM_RUNOUT_SENSORS) - 1));
}
#undef INIT_RUNOUT_PIN
};
#if ENABLED(FILAMENT_MOTION_SENSOR)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment