Add HAS_FILAMENT_SENSOR ahead of 12962

2.0.x
Scott Lahteine 6 years ago
parent 2c8d12d3ec
commit 7cf9b93f26

@ -136,7 +136,7 @@
#include "feature/power_loss_recovery.h" #include "feature/power_loss_recovery.h"
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#include "feature/runout.h" #include "feature/runout.h"
#endif #endif
@ -319,7 +319,7 @@ void disable_all_steppers() {
disable_e_steppers(); disable_e_steppers();
} }
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
void event_filament_runout() { void event_filament_runout() {
@ -379,7 +379,7 @@ void disable_all_steppers() {
enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT));
} }
#endif // FILAMENT_RUNOUT_SENSOR #endif // HAS_FILAMENT_SENSOR
#if ENABLED(G29_RETRY_AND_RECOVER) #if ENABLED(G29_RETRY_AND_RECOVER)
@ -426,7 +426,7 @@ void disable_all_steppers() {
*/ */
void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
runout.run(); runout.run();
#endif #endif
@ -827,7 +827,7 @@ void setup() {
#endif #endif
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
runout.setup(); runout.setup();
#endif #endif

@ -370,7 +370,7 @@ void protected_pin_err();
inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); } inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
void event_filament_runout(); void event_filament_runout();
#endif #endif

@ -33,7 +33,7 @@
#include "../gcode/queue.h" #include "../gcode/queue.h"
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#include "runout.h" #include "runout.h"
#endif #endif
@ -115,7 +115,7 @@ void host_action(const char * const pstr, const bool eol) {
host_action_prompt_begin(PSTR("Paused")); host_action_prompt_begin(PSTR("Paused"));
host_action_prompt_button(PSTR("Purge More")); host_action_prompt_button(PSTR("Purge More"));
if (false if (false
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
|| runout.filament_ran_out || runout.filament_ran_out
#endif #endif
) )
@ -127,7 +127,7 @@ void host_action(const char * const pstr, const bool eol) {
host_action_prompt_show(); host_action_prompt_show();
} }
else if (response == 1) { else if (response == 1) {
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
if (runout.filament_ran_out) { if (runout.filament_ran_out) {
runout.enabled = false; runout.enabled = false;
runout.reset(); runout.reset();

@ -41,7 +41,7 @@
#include "fwretract.h" #include "fwretract.h"
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#include "runout.h" #include "runout.h"
#endif #endif
@ -112,7 +112,7 @@ static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_
} }
void do_pause_e_move(const float &length, const float &fr) { void do_pause_e_move(const float &length, const float &fr) {
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
runout.reset(); runout.reset();
#endif #endif
current_position[E_AXIS] += length / planner.e_factor[active_extruder]; current_position[E_AXIS] += length / planner.e_factor[active_extruder];
@ -251,7 +251,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
host_action_prompt_begin(PSTR("Paused")); host_action_prompt_begin(PSTR("Paused"));
host_action_prompt_button(PSTR("PurgeMore")); host_action_prompt_button(PSTR("PurgeMore"));
if (false if (false
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
|| runout.filament_ran_out || runout.filament_ran_out
#endif #endif
) )

@ -24,7 +24,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#include "../runout.h" #include "../runout.h"
#endif #endif
@ -84,7 +84,7 @@ private:
static inline void set_runout_valid(const bool valid) { static inline void set_runout_valid(const bool valid) {
findaRunoutValid = valid; findaRunoutValid = valid;
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
if (valid) runout.reset(); if (valid) runout.reset();
#endif #endif
} }

@ -26,7 +26,7 @@
#include "../inc/MarlinConfigPre.h" #include "../inc/MarlinConfigPre.h"
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#include "runout.h" #include "runout.h"
@ -58,4 +58,4 @@ void FilamentSensorBase::filament_present(const uint8_t extruder) {
int8_t RunoutResponseDebounced::runout_count; // = 0 int8_t RunoutResponseDebounced::runout_count; // = 0
#endif #endif
#endif // FILAMENT_RUNOUT_SENSOR #endif // HAS_FILAMENT_SENSOR

@ -65,7 +65,7 @@ void GcodeSuite::M600() {
int8_t DXC_ext = target_extruder; int8_t DXC_ext = target_extruder;
if (!parser.seen('T')) { // If no tool index is specified, M600 was (probably) sent in response to filament runout. if (!parser.seen('T')) { // If no tool index is specified, M600 was (probably) sent in response to filament runout.
// In this case, for duplicating modes set DXC_ext to the extruder that ran out. // In this case, for duplicating modes set DXC_ext to the extruder that ran out.
#if ENABLED(FILAMENT_RUNOUT_SENSOR) && NUM_RUNOUT_SENSORS > 1 #if HAS_FILAMENT_SENSOR && NUM_RUNOUT_SENSORS > 1
if (dxc_is_duplicating()) if (dxc_is_duplicating())
DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_INVERTING) ? 1 : 0; DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_INVERTING) ? 1 : 0;
#else #else

@ -22,7 +22,7 @@
#include "../../../inc/MarlinConfig.h" #include "../../../inc/MarlinConfig.h"
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#include "../../gcode.h" #include "../../gcode.h"
#include "../../../feature/runout.h" #include "../../../feature/runout.h"
@ -50,4 +50,4 @@ void GcodeSuite::M412() {
} }
} }
#endif // FILAMENT_RUNOUT_SENSOR #endif // HAS_FILAMENT_SENSOR

@ -576,7 +576,7 @@ void GcodeSuite::process_parsed_command(
case 407: M407(); break; // M407: Display measured filament diameter case 407: M407(); break; // M407: Display measured filament diameter
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
case 412: M412(); break; // M412: Enable/Disable filament runout detection case 412: M412(); break; // M412: Enable/Disable filament runout detection
#endif #endif

@ -723,7 +723,7 @@ private:
static void M407(); static void M407();
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
static void M412(); static void M412();
#endif #endif

@ -528,6 +528,7 @@
#define HAS_LEDS_OFF_FLAG (ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT) && HAS_RESUME_CONTINUE) #define HAS_LEDS_OFF_FLAG (ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT) && HAS_RESUME_CONTINUE)
#define HAS_PRINT_PROGRESS (ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY)) #define HAS_PRINT_PROGRESS (ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY))
#define HAS_SERVICE_INTERVALS (SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0) #define HAS_SERVICE_INTERVALS (SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0)
#define HAS_FILAMENT_SENSOR ENABLED(FILAMENT_RUNOUT_SENSOR)
#define Z_MULTI_STEPPER_DRIVERS (ENABLED(Z_DUAL_STEPPER_DRIVERS) || ENABLED(Z_TRIPLE_STEPPER_DRIVERS)) #define Z_MULTI_STEPPER_DRIVERS (ENABLED(Z_DUAL_STEPPER_DRIVERS) || ENABLED(Z_TRIPLE_STEPPER_DRIVERS))
#define Z_MULTI_ENDSTOPS (ENABLED(Z_DUAL_ENDSTOPS) || ENABLED(Z_TRIPLE_ENDSTOPS)) #define Z_MULTI_ENDSTOPS (ENABLED(Z_DUAL_ENDSTOPS) || ENABLED(Z_TRIPLE_ENDSTOPS))

@ -62,7 +62,7 @@
#ifndef ACTION_ON_KILL #ifndef ACTION_ON_KILL
#define ACTION_ON_KILL "poweroff" #define ACTION_ON_KILL "poweroff"
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#ifndef ACTION_ON_FILAMENT_RUNOUT #ifndef ACTION_ON_FILAMENT_RUNOUT
#define ACTION_ON_FILAMENT_RUNOUT "filament_runout" #define ACTION_ON_FILAMENT_RUNOUT "filament_runout"
#endif #endif

@ -582,7 +582,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/** /**
* Filament Runout needs one or more pins 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_FILAMENT_SENSOR
#if !PIN_EXISTS(FIL_RUNOUT) #if !PIN_EXISTS(FIL_RUNOUT)
#error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
#elif NUM_RUNOUT_SENSORS > E_STEPPERS #elif NUM_RUNOUT_SENSORS > E_STEPPERS

@ -87,7 +87,7 @@
#endif #endif
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#include "../../feature/runout.h" #include "../../feature/runout.h"
#endif #endif
@ -383,7 +383,7 @@ namespace ExtUI {
planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(extruder - E0)] = value; planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(extruder - E0)] = value;
} }
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
bool getFilamentRunoutEnabled() { return runout.enabled; } bool getFilamentRunoutEnabled() { return runout.enabled; }
void setFilamentRunoutEnabled(const bool value) { runout.enabled = value; } void setFilamentRunoutEnabled(const bool value) { runout.enabled = value; }

@ -167,7 +167,7 @@ namespace ExtUI {
#endif #endif
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
bool getFilamentRunoutEnabled(); bool getFilamentRunoutEnabled();
void setFilamentRunoutEnabled(const bool); void setFilamentRunoutEnabled(const bool);

@ -32,7 +32,7 @@
#include "../../module/configuration_store.h" #include "../../module/configuration_store.h"
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#include "../../feature/runout.h" #include "../../feature/runout.h"
#endif #endif
@ -312,7 +312,7 @@ void menu_configuration() {
MENU_ITEM(submenu, MSG_RETRACT, menu_config_retract); MENU_ITEM(submenu, MSG_RETRACT, menu_config_retract);
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
MENU_ITEM_EDIT_CALLBACK(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset); MENU_ITEM_EDIT_CALLBACK(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset);
#endif #endif

@ -31,7 +31,7 @@
#include "menu.h" #include "menu.h"
#include "../../module/temperature.h" #include "../../module/temperature.h"
#include "../../feature/pause.h" #include "../../feature/pause.h"
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#include "../../feature/runout.h" #include "../../feature/runout.h"
#endif #endif
// //
@ -352,7 +352,7 @@ void menu_advanced_pause_option() {
STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false); STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false);
#endif #endif
MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_PURGE, lcd_advanced_pause_extrude_more); MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_PURGE, lcd_advanced_pause_extrude_more);
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
if (runout.filament_ran_out) if (runout.filament_ran_out)
MENU_ITEM_EDIT_CALLBACK(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset); MENU_ITEM_EDIT_CALLBACK(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset);
else else

@ -428,7 +428,7 @@ void _O2 Endstops::M119() {
#if ENABLED(Z_MIN_PROBE_ENDSTOP) #if ENABLED(Z_MIN_PROBE_ENDSTOP)
print_es_state(READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING, PSTR(MSG_Z_PROBE)); print_es_state(READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING, PSTR(MSG_Z_PROBE));
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#if NUM_RUNOUT_SENSORS == 1 #if NUM_RUNOUT_SENSORS == 1
print_es_state(READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_INVERTING, PSTR(MSG_FILAMENT_RUNOUT_SENSOR)); print_es_state(READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_INVERTING, PSTR(MSG_FILAMENT_RUNOUT_SENSOR));
#else #else

@ -149,7 +149,7 @@
#define FAN_PIN 9 #define FAN_PIN 9
#endif #endif
#if DISABLED(FILAMENT_RUNOUT_SENSOR) #if !HAS_FILAMENT_SENSOR
#define FAN1_PIN 4 #define FAN1_PIN 4
#endif #endif

@ -144,7 +144,7 @@
#define FAN_PIN 9 #define FAN_PIN 9
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#define FIL_RUNOUT_PIN 4 #define FIL_RUNOUT_PIN 4
//#define FIL_RUNOUT2_PIN -1 //#define FIL_RUNOUT2_PIN -1
#else #else

@ -122,7 +122,7 @@
#define Z_MIN_PROBE_PIN 49 #define Z_MIN_PROBE_PIN 49
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#ifndef FIL_RUNOUT_PIN #ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN Y_MIN_PIN #define FIL_RUNOUT_PIN Y_MIN_PIN
#endif #endif

@ -110,7 +110,7 @@
#define Z_MIN_PROBE_PIN 49 #define Z_MIN_PROBE_PIN 49
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#ifndef FIL_RUNOUT_PIN #ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN Y_MIN_PIN #define FIL_RUNOUT_PIN Y_MIN_PIN
#endif #endif

Loading…
Cancel
Save