diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 163f7e83a6..2fee46b2fe 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -1197,6 +1197,9 @@ #ifndef MSG_RUNOUT_SENSOR #define MSG_RUNOUT_SENSOR _UxGT("Runout Sensor") #endif +#ifndef MSG_RUNOUT_DISTANCE_MM + #define MSG_RUNOUT_DISTANCE_MM _UxGT("Runout Dist mm") +#endif #ifndef MSG_ERR_HOMING_FAILED #define MSG_ERR_HOMING_FAILED _UxGT("Homing failed") #endif diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index c3c3a76aa6..432b37ad27 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -43,6 +43,11 @@ #include "../../module/temperature.h" #endif +#ifdef FILAMENT_RUNOUT_DISTANCE_MM + #include "../../feature/runout.h" + float lcd_runout_distance_mm; +#endif + void menu_tmc(); void menu_backlash(); @@ -214,6 +219,12 @@ void menu_backlash(); #endif // EXTRUDERS > 1 #endif + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + MENU_ITEM_EDIT_CALLBACK(float3, MSG_RUNOUT_DISTANCE_MM, &lcd_runout_distance_mm, 1, 30, []{ + runout.set_runout_distance(lcd_runout_distance_mm); + }); + #endif + END_MENU(); } @@ -603,6 +614,9 @@ void menu_backlash(); #endif // !SLIM_LCD_MENUS void menu_advanced_settings() { + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + lcd_runout_distance_mm = runout.runout_distance(); + #endif START_MENU(); MENU_BACK(MSG_CONFIGURATION);