From 512fe20e397c3d1e5b7a5e6dc6569fb370964117 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 May 2020 01:15:05 -0500 Subject: [PATCH] Fix poll_runout_states bug --- Marlin/src/feature/runout.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index 056fc4f5cd5b9..a170d5e32391d 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -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)