Browse Source

Fix poll_runout_states bug

Scott Lahteine 5 years ago
parent
commit
544b16639e
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      Marlin/src/feature/runout.h

+ 2
- 3
Marlin/src/feature/runout.h View File

@@ -140,6 +140,7 @@ class FilamentSensorBase {
140 140
       #define _INIT_RUNOUT(N) INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN);
141 141
       REPEAT_S(1, INCREMENT(NUM_RUNOUT_SENSORS), _INIT_RUNOUT)
142 142
       #undef _INIT_RUNOUT
143
+      #undef INIT_RUNOUT_PIN
143 144
     }
144 145
 
145 146
     // Return a bitmask of runout pin states
@@ -151,10 +152,8 @@ class FilamentSensorBase {
151 152
 
152 153
     // Return a bitmask of runout flag states (1 bits always indicates runout)
153 154
     static inline uint8_t poll_runout_states() {
154
-      return poll_runout_pins() ^ uint8_t(TERN0(FIL_RUNOUT_INVERTING, _BV(NUM_RUNOUT_SENSORS) - 1));
155
+      return poll_runout_pins() ^ uint8_t(TERN(FIL_RUNOUT_INVERTING, 0, _BV(NUM_RUNOUT_SENSORS) - 1));
155 156
     }
156
-
157
-  #undef INIT_RUNOUT_PIN
158 157
 };
159 158
 
160 159
 #if ENABLED(FILAMENT_MOTION_SENSOR)

Loading…
Cancel
Save