Default Filament Runout Sensor enabled state (#19013)
This commit is contained in:
committed by
Scott Lahteine
parent
5a7979b435
commit
16c1e80491
@ -44,14 +44,6 @@ bool FilamentMonitorBase::enabled = true,
|
||||
#include "../module/tool_change.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Called by FilamentSensorSwitch::run when filament is detected.
|
||||
* Called by FilamentSensorEncoder::block_completed when motion is detected.
|
||||
*/
|
||||
void FilamentSensorBase::filament_present(const uint8_t extruder) {
|
||||
runout.filament_present(extruder); // calls response.filament_present(extruder)
|
||||
}
|
||||
|
||||
#if HAS_FILAMENT_RUNOUT_DISTANCE
|
||||
float RunoutResponseDelayed::runout_distance_mm = FILAMENT_RUNOUT_DISTANCE_MM;
|
||||
volatile float RunoutResponseDelayed::runout_mm_countdown[EXTRUDERS];
|
||||
|
@ -48,6 +48,24 @@
|
||||
|
||||
void event_filament_runout();
|
||||
|
||||
template<class RESPONSE_T, class SENSOR_T>
|
||||
class TFilamentMonitor;
|
||||
class FilamentSensorEncoder;
|
||||
class FilamentSensorSwitch;
|
||||
class RunoutResponseDelayed;
|
||||
class RunoutResponseDebounced;
|
||||
|
||||
/********************************* TEMPLATE SPECIALIZATION *********************************/
|
||||
|
||||
typedef TFilamentMonitor<
|
||||
TERN(HAS_FILAMENT_RUNOUT_DISTANCE, RunoutResponseDelayed, RunoutResponseDebounced),
|
||||
TERN(FILAMENT_MOTION_SENSOR, FilamentSensorEncoder, FilamentSensorSwitch)
|
||||
> FilamentMonitor;
|
||||
|
||||
extern FilamentMonitor runout;
|
||||
|
||||
/*******************************************************************************************/
|
||||
|
||||
class FilamentMonitorBase {
|
||||
public:
|
||||
static bool enabled, filament_ran_out;
|
||||
@ -121,7 +139,13 @@ class TFilamentMonitor : public FilamentMonitorBase {
|
||||
|
||||
class FilamentSensorBase {
|
||||
protected:
|
||||
static void filament_present(const uint8_t extruder);
|
||||
/**
|
||||
* Called by FilamentSensorSwitch::run when filament is detected.
|
||||
* Called by FilamentSensorEncoder::block_completed when motion is detected.
|
||||
*/
|
||||
static inline void filament_present(const uint8_t extruder) {
|
||||
runout.filament_present(extruder); // ...which calls response.filament_present(extruder)
|
||||
}
|
||||
|
||||
public:
|
||||
static inline void setup() {
|
||||
@ -311,12 +335,3 @@ class FilamentSensorBase {
|
||||
};
|
||||
|
||||
#endif // !HAS_FILAMENT_RUNOUT_DISTANCE
|
||||
|
||||
/********************************* TEMPLATE SPECIALIZATION *********************************/
|
||||
|
||||
typedef TFilamentMonitor<
|
||||
TERN(HAS_FILAMENT_RUNOUT_DISTANCE, RunoutResponseDelayed, RunoutResponseDebounced),
|
||||
TERN(FILAMENT_MOTION_SENSOR, FilamentSensorEncoder, FilamentSensorSwitch)
|
||||
> FilamentMonitor;
|
||||
|
||||
extern FilamentMonitor runout;
|
||||
|
Reference in New Issue
Block a user