Add HAS_FILAMENT_SENSOR ahead of 12962

This commit is contained in:
Scott Lahteine 2019-02-12 20:08:34 -06:00
parent 2c8d12d3ec
commit 7cf9b93f26
22 changed files with 36 additions and 35 deletions

View File

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

View File

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

View File

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

View File

@ -41,7 +41,7 @@
#include "fwretract.h"
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
#include "runout.h"
#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) {
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
runout.reset();
#endif
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_button(PSTR("PurgeMore"));
if (false
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
|| runout.filament_ran_out
#endif
)

View File

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

View File

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

View File

@ -65,7 +65,7 @@ void GcodeSuite::M600() {
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.
// 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())
DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_INVERTING) ? 1 : 0;
#else

View File

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

View File

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

View File

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

View File

@ -528,6 +528,7 @@
#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_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_ENDSTOPS (ENABLED(Z_DUAL_ENDSTOPS) || ENABLED(Z_TRIPLE_ENDSTOPS))

View File

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

View File

@ -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
*/
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
#if !PIN_EXISTS(FIL_RUNOUT)
#error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
#elif NUM_RUNOUT_SENSORS > E_STEPPERS

View File

@ -87,7 +87,7 @@
#endif
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
#include "../../feature/runout.h"
#endif
@ -383,7 +383,7 @@ namespace ExtUI {
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; }
void setFilamentRunoutEnabled(const bool value) { runout.enabled = value; }

View File

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

View File

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

View File

@ -31,7 +31,7 @@
#include "menu.h"
#include "../../module/temperature.h"
#include "../../feature/pause.h"
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
#include "../../feature/runout.h"
#endif
//
@ -352,7 +352,7 @@ void menu_advanced_pause_option() {
STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false);
#endif
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)
MENU_ITEM_EDIT_CALLBACK(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset);
else

View File

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

View File

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

View File

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

View File

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

View File

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