Selaa lähdekoodia

Add filament runout sensor menu item (#11971)

InsanityAutomation 6 vuotta sitten
vanhempi
commit
4d5566a6b7

+ 2
- 1
Marlin/src/feature/runout.cpp Näytä tiedosto

@@ -32,7 +32,8 @@
32 32
 
33 33
 FilamentRunoutSensor runout;
34 34
 
35
-bool FilamentRunoutSensor::filament_ran_out; // = false
35
+bool FilamentRunoutSensor::enabled = true,
36
+     FilamentRunoutSensor::filament_ran_out; // = false
36 37
 uint8_t FilamentRunoutSensor::runout_count; // = 0
37 38
 
38 39
 void FilamentRunoutSensor::setup() {

+ 3
- 0
Marlin/src/feature/runout.h Näytä tiedosto

@@ -38,6 +38,8 @@
38 38
 
39 39
 class FilamentRunoutSensor {
40 40
   public:
41
+    static bool enabled;
42
+
41 43
     FilamentRunoutSensor() {}
42 44
 
43 45
     static void setup();
@@ -56,6 +58,7 @@ class FilamentRunoutSensor {
56 58
     static uint8_t runout_count;
57 59
 
58 60
     FORCE_INLINE static bool check() {
61
+      if (!enabled) return false;
59 62
       #if NUM_RUNOUT_SENSORS < 2
60 63
         // A single sensor applying to all extruders
61 64
         const bool is_out = READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING;

+ 4
- 1
Marlin/src/lcd/language/language_en.h Näytä tiedosto

@@ -973,7 +973,7 @@
973 973
   #define MSG_CASE_LIGHT                      _UxGT("Case light")
974 974
 #endif
975 975
 #ifndef MSG_CASE_LIGHT_BRIGHTNESS
976
-  #define MSG_CASE_LIGHT_BRIGHTNESS           _UxGT("Light BRIGHTNESS")
976
+  #define MSG_CASE_LIGHT_BRIGHTNESS           _UxGT("Light Brightness")
977 977
 #endif
978 978
 #if LCD_WIDTH >= 20
979 979
   #ifndef MSG_INFO_PRINT_COUNT
@@ -1047,6 +1047,9 @@
1047 1047
 #ifndef MSG_FILAMENT_CHANGE_NOZZLE
1048 1048
   #define MSG_FILAMENT_CHANGE_NOZZLE          _UxGT("  Nozzle: ")
1049 1049
 #endif
1050
+#ifndef MSG_RUNOUT_SENSOR_ENABLE
1051
+  #define MSG_RUNOUT_SENSOR_ENABLE            _UxGT("Runout Sensor")
1052
+#endif
1050 1053
 #ifndef MSG_ERR_HOMING_FAILED
1051 1054
   #define MSG_ERR_HOMING_FAILED               _UxGT("Homing failed")
1052 1055
 #endif

+ 8
- 0
Marlin/src/lcd/ultralcd.cpp Näytä tiedosto

@@ -71,6 +71,10 @@
71 71
   #include "../feature/leds/leds.h"
72 72
 #endif
73 73
 
74
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
75
+  #include "../feature/runout.h"
76
+#endif
77
+
74 78
 #if DISABLED(LCD_USE_I2C_BUZZER)
75 79
   #include "../libs/buzzer.h"
76 80
 #endif
@@ -3428,6 +3432,10 @@ void lcd_quick_feedback(const bool clear_buttons) {
3428 3432
       MENU_ITEM(submenu, MSG_BLTOUCH, bltouch_menu);
3429 3433
     #endif
3430 3434
 
3435
+    #if ENABLED(FILAMENT_RUNOUT_SENSOR)
3436
+      MENU_ITEM_EDIT(bool, MSG_RUNOUT_SENSOR_ENABLE, &runout.enabled);
3437
+    #endif
3438
+
3431 3439
     #if DISABLED(SLIM_LCD_MENUS)
3432 3440
       // Preheat configurations
3433 3441
       MENU_ITEM(submenu, MSG_PREHEAT_1_SETTINGS, lcd_configuration_temperature_preheat_material1_settings_menu);

Loading…
Peruuta
Tallenna