Commit 0895f853 authored by MagoKimbra's avatar MagoKimbra

Fix Filrunout

parent e82b1225
...@@ -596,10 +596,11 @@ your extruder heater takes 2 minutes to hit the target on heating. ...@@ -596,10 +596,11 @@ your extruder heater takes 2 minutes to hit the target on heating.
//=========================================================================== //===========================================================================
//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
// It is assumed that when logic high = filament available // It is assumed that when logic high = filament available
// when logic low = filament ran out // when logic low = filament run out
#ifdef FILAMENT_RUNOUT_SENSOR #ifdef FILAMENT_RUNOUT_SENSOR
const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600" // Script execute when filament run out
#endif #endif
//=========================================================================== //===========================================================================
......
...@@ -568,7 +568,7 @@ void setup_filrunoutpin() { ...@@ -568,7 +568,7 @@ void setup_filrunoutpin() {
#if HAS_FILRUNOUT #if HAS_FILRUNOUT
pinMode(FILRUNOUT_PIN, INPUT); pinMode(FILRUNOUT_PIN, INPUT);
#ifdef ENDSTOPPULLUP_FIL_RUNOUT #ifdef ENDSTOPPULLUP_FIL_RUNOUT
WRITE(FILLRUNOUT_PIN, HIGH); WRITE(FILRUNOUT_PIN, HIGH);
#endif #endif
#endif #endif
} }
...@@ -6606,7 +6606,7 @@ void disable_all_steppers() { ...@@ -6606,7 +6606,7 @@ void disable_all_steppers() {
void manage_inactivity(bool ignore_stepper_queue/*=false*/) { void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
#if HAS_FILRUNOUT #if HAS_FILRUNOUT
if ((printing || card.sdprinting) && (READ(FILRUNOUT_PIN) ^ FIL_RUNOUT_INVERTING)) if ((printing || IS_SD_PRINTING ) && (READ(FILRUNOUT_PIN) ^ FIL_RUNOUT_INVERTING))
filrunout(); filrunout();
#endif #endif
...@@ -6791,7 +6791,8 @@ void kill() { ...@@ -6791,7 +6791,8 @@ void kill() {
void filrunout() { void filrunout() {
if (!filrunoutEnqueued) { if (!filrunoutEnqueued) {
filrunoutEnqueued = true; filrunoutEnqueued = true;
enqueuecommand("M600"); enqueuecommands_P(PSTR(FILAMENT_RUNOUT_SCRIPT));
st_synchronize();
} }
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment