Add HAS_FILAMENT_RUNOUT_DISTANCE

This commit is contained in:
Scott Lahteine
2020-05-05 23:18:23 -05:00
parent 45488a431a
commit cfd31ff70e
10 changed files with 32 additions and 46 deletions

View File

@ -35,7 +35,7 @@ void FilamentRunoutScreen::onRedraw(draw_mode_t what) {
w.heading( GET_TEXT_F(MSG_FILAMENT));
w.toggle( 2, GET_TEXT_F(MSG_RUNOUT_SENSOR), getFilamentRunoutEnabled());
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
#if HAS_FILAMENT_RUNOUT_DISTANCE
extern const char NUL_STR[];
w.heading(GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM));
w.units(GET_TEXT_F(MSG_UNITS_MM));
@ -51,7 +51,7 @@ bool FilamentRunoutScreen::onTouchHeld(uint8_t tag) {
const float increment = getIncrement();
switch (tag) {
case 2: setFilamentRunoutEnabled(!getFilamentRunoutEnabled()); break;
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
#if HAS_FILAMENT_RUNOUT_DISTANCE
case 10: UI_DECREMENT(FilamentRunoutDistance_mm); break;
case 11: UI_INCREMENT(FilamentRunoutDistance_mm); break;
#endif

View File

@ -591,7 +591,7 @@ namespace ExtUI {
bool getFilamentRunoutEnabled() { return runout.enabled; }
void setFilamentRunoutEnabled(const bool value) { runout.enabled = value; }
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
#if HAS_FILAMENT_RUNOUT_DISTANCE
float getFilamentRunoutDistance_mm() { return runout.runout_distance(); }
void setFilamentRunoutDistance_mm(const float value) { runout.set_runout_distance(constrain(value, 0, 999)); }
#endif

View File

@ -237,7 +237,7 @@ namespace ExtUI {
bool getFilamentRunoutEnabled();
void setFilamentRunoutEnabled(const bool);
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
#if HAS_FILAMENT_RUNOUT_DISTANCE
float getFilamentRunoutDistance_mm();
void setFilamentRunoutDistance_mm(const float);
#endif