Support for multiple filament runout sensors

This commit is contained in:
Studiodyne
2018-02-18 09:42:09 +01:00
committed by Scott Lahteine
parent 0106c3e476
commit d3ca82d8c2
7 changed files with 98 additions and 41 deletions

View File

@ -792,7 +792,6 @@
// Sensors
#define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH))
#define HAS_FIL_RUNOUT (PIN_EXISTS(FIL_RUNOUT))
// User Interface
#define HAS_HOME (PIN_EXISTS(HOME))

View File

@ -429,11 +429,21 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
#endif
/**
* Filament Runout needs a pin and either SD Support or Auto print start detection
* Filament Runout needs one or more pins and either SD Support or Auto print start detection
*/
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if !HAS_FIL_RUNOUT
#if !PIN_EXISTS(FIL_RUNOUT)
#error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
#elif NUM_RUNOUT_SENSORS > E_STEPPERS
#error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers."
#elif NUM_RUNOUT_SENSORS > 1 && !PIN_EXISTS(FIL_RUNOUT2)
#error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 1 requires FIL_RUNOUT2_PIN."
#elif NUM_RUNOUT_SENSORS > 2 && !PIN_EXISTS(FIL_RUNOUT3)
#error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 2 requires FIL_RUNOUT3_PIN."
#elif NUM_RUNOUT_SENSORS > 3 && !PIN_EXISTS(FIL_RUNOUT4)
#error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 3 requires FIL_RUNOUT4_PIN."
#elif NUM_RUNOUT_SENSORS > 4 && !PIN_EXISTS(FIL_RUNOUT5)
#error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 4 requires FIL_RUNOUT5_PIN."
#elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART)
#error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART."
#elif DISABLED(ADVANCED_PAUSE_FEATURE)