Skip to content

Commit

Permalink
🐛 Fix pulldown sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 26, 2022
1 parent 959c559 commit b1958a4
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 12 deletions.
4 changes: 4 additions & 0 deletions Marlin/src/HAL/AVR/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@
#if ENABLED(POSTMORTEM_DEBUGGING)
#error "POSTMORTEM_DEBUGGING is not supported on AVR boards."
#endif

#if USING_PULLDOWNS
#error "PULLDOWN pin mode is not available on AVR boards."
#endif
4 changes: 4 additions & 0 deletions Marlin/src/HAL/DUE/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@
#if HAS_TMC_SW_SERIAL
#error "TMC220x Software Serial is not supported on the DUE platform."
#endif

#if USING_PULLDOWNS
#error "PULLDOWN pin mode is not available on DUE boards."
#endif
4 changes: 4 additions & 0 deletions Marlin/src/HAL/ESP32/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@
#if MB(MKS_TINYBEE) && ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not available on TinyBee."
#endif

#if USING_PULLDOWNS
#error "PULLDOWN pin mode is not available on ESP32 boards."
#endif
4 changes: 4 additions & 0 deletions Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@
#if ENABLED(POSTMORTEM_DEBUGGING)
#error "POSTMORTEM_DEBUGGING is not yet supported on Teensy 3.1/3.2."
#endif

#if USING_PULLDOWNS
#error "PULLDOWN pin mode is not available on Teensy 3.1/3.2 boards."
#endif
4 changes: 4 additions & 0 deletions Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@
#if ENABLED(POSTMORTEM_DEBUGGING)
#error "POSTMORTEM_DEBUGGING is not yet supported on Teensy 3.5/3.6."
#endif

#if USING_PULLDOWNS
#error "PULLDOWN pin mode is not available on Teensy 3.5/3.6 boards."
#endif
11 changes: 11 additions & 0 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -3507,3 +3507,14 @@
#if PIN_EXISTS(SAFE_POWER) && DISABLED(DISABLE_DRIVER_SAFE_POWER_PROTECT)
#define HAS_DRIVER_SAFE_POWER_PROTECT 1
#endif

#if ANY(ENDSTOPPULLDOWNS, ENDSTOPPULLDOWN_ZMIN_PROBE, \
ENDSTOPPULLDOWN_XMIN, ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN, \
ENDSTOPPULLDOWN_IMIN, ENDSTOPPULLDOWN_JMIN, ENDSTOPPULLDOWN_KMIN, \
ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, ENDSTOPPULLDOWN_ZMAX, \
ENDSTOPPULLDOWN_IMAX, ENDSTOPPULLDOWN_JMAX, ENDSTOPPULLDOWN_KMAX, \
POWER_LOSS_PULLDOWN, CALIBRATION_PIN_PULLDOWN, FIL_RUNOUT_PULLDOWN, \
FIL_RUNOUT1_PULLDOWN, FIL_RUNOUT2_PULLDOWN, FIL_RUNOUT3_PULLDOWN, FIL_RUNOUT4_PULLDOWN, \
FIL_RUNOUT5_PULLDOWN, FIL_RUNOUT6_PULLDOWN, FIL_RUNOUT7_PULLDOWN, FIL_RUNOUT8_PULLDOWN)
#define USING_PULLDOWNS 1
#endif
12 changes: 0 additions & 12 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -782,18 +782,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#endif
#endif

#if !defined(TARGET_LPC1768) && ANY( \
ENDSTOPPULLDOWNS, ENDSTOPPULLDOWN_ZMIN_PROBE, \
ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, ENDSTOPPULLDOWN_ZMAX, \
ENDSTOPPULLDOWN_XMIN, ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN, \
FIL_RUNOUT_PULLDOWN, \
FIL_RUNOUT1_PULLDOWN, FIL_RUNOUT2_PULLDOWN, FIL_RUNOUT3_PULLDOWN, FIL_RUNOUT4_PULLDOWN, \
FIL_RUNOUT5_PULLDOWN, FIL_RUNOUT6_PULLDOWN, FIL_RUNOUT7_PULLDOWN, FIL_RUNOUT8_PULLDOWN, \
POWER_LOSS_PULLDOWN, CALIBRATION_PIN_PULLDOWN \
)
#error "PULLDOWN pin mode is not available on the selected board."
#endif

#if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS)
#error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
#elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN)
Expand Down

0 comments on commit b1958a4

Please sign in to comment.