diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 9b6e2ef0dd..675bed880f 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -708,7 +708,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0a65a7478d..4892aede9f 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -9488,7 +9488,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)) + if ((IS_SD_PRINTING || print_job_timer.isRunning()) && (READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING)) handle_filament_runout(); #endif diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 2281c9cf11..7fef2d4f95 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -708,7 +708,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 72bbc1b2d2..826267041d 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -691,7 +691,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 9d83b318da..3a5bcd6227 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -691,7 +691,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 61ccc7a0c0..60393bb2e4 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -700,7 +700,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 5c19fb1a8d..51c5adf7d9 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -702,7 +702,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 669b153b99..c0801e7d0f 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -725,7 +725,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 05f8a9c99b..698464039d 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -708,7 +708,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 4fd1a9f8a9..cbfe32d780 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -708,7 +708,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index f307761776..586dd7d5c8 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -708,7 +708,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 54631863a8..52f7d8ec71 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -706,7 +706,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index ba229bb42f..a766d793d1 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -723,7 +723,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 0a8cf114a5..df3b9dc8d7 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -729,7 +729,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 01f9bb93fd..b09c43e826 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -700,7 +700,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 4a0f3e010c..bb378b14e8 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -708,7 +708,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 4dba4fc738..6c6b6547a1 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -800,7 +800,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 5632578311..4b43020df2 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -794,7 +794,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 1adcd15204..8cbd98cdb4 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -797,7 +797,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index f32c661c77..e157874337 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -798,7 +798,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 0352f4add2..9bf6675480 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -800,7 +800,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 1e98417041..daa4c84a3c 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -711,7 +711,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index a860f48158..0eb2832b5e 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -704,7 +704,7 @@ // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif