[2.0.x] Enhancements to FILAMENT_RUNOUT_SENSOR (#12069)
- Added FILAMENT_RUNOUT_DISTANCE_MM option - Added FILAMENT_MOTION_SENSOR option
This commit is contained in:
committed by
Scott Lahteine
parent
cce4931342
commit
056561df93
@ -53,6 +53,10 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
||||
#include "../../feature/runout.h"
|
||||
#endif
|
||||
|
||||
inline float clamp(const float value, const float minimum, const float maximum) {
|
||||
return MAX(MIN(value, maximum), minimum);
|
||||
}
|
||||
@ -209,6 +213,21 @@ namespace UI {
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
||||
bool isFilamentRunoutEnabled() { return runout.enabled; }
|
||||
void toggleFilamentRunout(const bool state) { runout.enabled = state; }
|
||||
|
||||
#if FILAMENT_RUNOUT_DISTANCE_MM > 0
|
||||
float getFilamentRunoutDistance_mm() {
|
||||
return RunoutResponseDelayed::runout_distance_mm;
|
||||
}
|
||||
|
||||
void setFilamentRunoutDistance_mm(const float distance) {
|
||||
RunoutResponseDelayed::runout_distance_mm = clamp(distance, 0, 999);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
float getLinearAdvance_mm_mm_s(const uint8_t extruder) {
|
||||
return (extruder < EXTRUDERS) ? planner.extruder_advance_K[extruder] : 0;
|
||||
|
@ -109,6 +109,16 @@ namespace UI {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
||||
bool isFilamentRunoutEnabled();
|
||||
void toggleFilamentRunout(const bool state);
|
||||
|
||||
#if FILAMENT_RUNOUT_DISTANCE_MM > 0
|
||||
float getFilamentRunoutDistance_mm();
|
||||
void setFilamentRunoutDistance_mm(const float distance);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void delay_ms(unsigned long ms);
|
||||
void yield(); // Within lengthy loop, call this periodically
|
||||
|
||||
|
Reference in New Issue
Block a user