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

@ -216,20 +216,6 @@ void setup_killpin() {
#endif
}
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
void setup_filrunoutpin() {
#if ENABLED(FIL_RUNOUT_PULLUP)
SET_INPUT_PULLUP(FIL_RUNOUT_PIN);
#elif ENABLED(FIL_RUNOUT_PULLDOWN)
SET_INPUT_PULLDOWN(FIL_RUNOUT_PIN);
#else
SET_INPUT(FIL_RUNOUT_PIN);
#endif
}
#endif
void setup_powerhold() {
#if HAS_SUICIDE
OUT_WRITE(SUICIDE_PIN, HIGH);
@ -336,11 +322,7 @@ void disable_all_steppers() {
void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
if ((IS_SD_PRINTING || print_job_timer.isRunning())
&& READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING
&& thermalManager.targetHotEnoughToExtrude(active_extruder)
)
handle_filament_runout();
runout.run();
#endif
if (commands_in_queue < BUFSIZE) get_available_commands();
@ -661,7 +643,7 @@ void setup() {
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
setup_filrunoutpin();
runout.setup();
#endif
setup_killpin();