Pulldown pin mode support (#9701)

Implemented for LPC1768.
This commit is contained in:
Scott Lahteine
2018-02-18 19:26:23 -06:00
committed by GitHub
parent aef9e036bf
commit ca55f2927a
66 changed files with 1182 additions and 325 deletions

View File

@ -616,6 +616,30 @@
#endif
#endif
/**
* Set ENDSTOPPULLDOWNS for active endstop switches
*/
#if ENABLED(ENDSTOPPULLDOWNS)
#if ENABLED(USE_XMAX_PLUG)
#define ENDSTOPPULLDOWN_XMAX
#endif
#if ENABLED(USE_YMAX_PLUG)
#define ENDSTOPPULLDOWN_YMAX
#endif
#if ENABLED(USE_ZMAX_PLUG)
#define ENDSTOPPULLDOWN_ZMAX
#endif
#if ENABLED(USE_XMIN_PLUG)
#define ENDSTOPPULLDOWN_XMIN
#endif
#if ENABLED(USE_YMIN_PLUG)
#define ENDSTOPPULLDOWN_YMIN
#endif
#if ENABLED(USE_ZMIN_PLUG)
#define ENDSTOPPULLDOWN_ZMIN
#endif
#endif
/**
* Shorthand for pin tests, used wherever needed
*/

View File

@ -78,7 +78,9 @@
#elif defined(SDEXTRASLOW)
#error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead."
#elif defined(FILAMENT_SENSOR)
#error "FILAMENT_SENSOR is deprecated. Use FILAMENT_WIDTH_SENSOR instead."
#error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration."
#elif defined(ENDSTOPPULLUP_FIL_RUNOUT)
#error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP. Please update your configuration."
#elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
#error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead."
#elif defined(LANGUAGE_INCLUDE)
@ -323,6 +325,35 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
#endif
#endif
#if !defined(TARGET_LPC1768) && ( \
ENABLED(ENDSTOPPULLDOWNS) \
|| ENABLED(ENDSTOPPULLDOWN_XMAX) \
|| ENABLED(ENDSTOPPULLDOWN_YMAX) \
|| ENABLED(ENDSTOPPULLDOWN_ZMAX) \
|| ENABLED(ENDSTOPPULLDOWN_XMIN) \
|| ENABLED(ENDSTOPPULLDOWN_YMIN) \
|| ENABLED(ENDSTOPPULLDOWN_ZMIN) )
#error "PULLDOWN pin mode is not available on the selected board."
#endif
#if ENABLED(ENDSTOPPULLUPS) && ENABLED(ENDSTOPPULLDOWNS)
#error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
#elif ENABLED(FIL_RUNOUT_PULLUP) && ENABLED(FIL_RUNOUT_PULLDOWN)
#error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN."
#elif ENABLED(ENDSTOPPULLUP_XMAX) && ENABLED(ENDSTOPPULLDOWN_XMAX)
#error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX."
#elif ENABLED(ENDSTOPPULLUP_YMAX) && ENABLED(ENDSTOPPULLDOWN_YMAX)
#error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
#elif ENABLED(ENDSTOPPULLUP_ZMAX) && ENABLED(ENDSTOPPULLDOWN_ZMAX)
#error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
#elif ENABLED(ENDSTOPPULLUP_XMIN) && ENABLED(ENDSTOPPULLDOWN_XMIN)
#error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
#elif ENABLED(ENDSTOPPULLUP_YMIN) && ENABLED(ENDSTOPPULLDOWN_YMIN)
#error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN."
#elif ENABLED(ENDSTOPPULLUP_ZMIN) && ENABLED(ENDSTOPPULLDOWN_ZMIN)
#error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN."
#endif
/**
* Progress Bar
*/