Fix backward Filament (Presence) Sensor pulls (#20228)

Co-authored-by: Kurt Haenen <Kurt.Haenen@quintux.com>
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
Kurt Haenen 2020-11-21 02:48:53 +01:00 committed by Scott Lahteine
parent 7f84a7a85e
commit 9ebe050646

View File

@ -149,7 +149,7 @@ class FilamentSensorBase {
public: public:
static inline void setup() { static inline void setup() {
#define _INIT_RUNOUT_PIN(P,S,U) do{ if (DISABLED(U)) SET_INPUT(P); else if (S) SET_INPUT_PULLDOWN(P); else SET_INPUT_PULLUP(P); }while(0) #define _INIT_RUNOUT_PIN(P,S,U) do{ if (DISABLED(U)) SET_INPUT(P); else if (S) SET_INPUT_PULLUP(P); else SET_INPUT_PULLDOWN(P); }while(0)
#define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULL) #define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULL)
#if NUM_RUNOUT_SENSORS >= 1 #if NUM_RUNOUT_SENSORS >= 1
INIT_RUNOUT_PIN(1); INIT_RUNOUT_PIN(1);