Browse Source

Add filament runout sensor menu item (#11971)

pull/1/head
InsanityAutomation 6 years ago
committed by Scott Lahteine
parent
commit
4d5566a6b7
  1. 3
      Marlin/src/feature/runout.cpp
  2. 3
      Marlin/src/feature/runout.h
  3. 5
      Marlin/src/lcd/language/language_en.h
  4. 8
      Marlin/src/lcd/ultralcd.cpp

3
Marlin/src/feature/runout.cpp

@ -32,7 +32,8 @@
FilamentRunoutSensor runout; FilamentRunoutSensor runout;
bool FilamentRunoutSensor::filament_ran_out; // = false bool FilamentRunoutSensor::enabled = true,
FilamentRunoutSensor::filament_ran_out; // = false
uint8_t FilamentRunoutSensor::runout_count; // = 0 uint8_t FilamentRunoutSensor::runout_count; // = 0
void FilamentRunoutSensor::setup() { void FilamentRunoutSensor::setup() {

3
Marlin/src/feature/runout.h

@ -38,6 +38,8 @@
class FilamentRunoutSensor { class FilamentRunoutSensor {
public: public:
static bool enabled;
FilamentRunoutSensor() {} FilamentRunoutSensor() {}
static void setup(); static void setup();
@ -56,6 +58,7 @@ class FilamentRunoutSensor {
static uint8_t runout_count; static uint8_t runout_count;
FORCE_INLINE static bool check() { FORCE_INLINE static bool check() {
if (!enabled) return false;
#if NUM_RUNOUT_SENSORS < 2 #if NUM_RUNOUT_SENSORS < 2
// A single sensor applying to all extruders // A single sensor applying to all extruders
const bool is_out = READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING; const bool is_out = READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING;

5
Marlin/src/lcd/language/language_en.h

@ -973,7 +973,7 @@
#define MSG_CASE_LIGHT _UxGT("Case light") #define MSG_CASE_LIGHT _UxGT("Case light")
#endif #endif
#ifndef MSG_CASE_LIGHT_BRIGHTNESS #ifndef MSG_CASE_LIGHT_BRIGHTNESS
#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Light BRIGHTNESS") #define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Light Brightness")
#endif #endif
#if LCD_WIDTH >= 20 #if LCD_WIDTH >= 20
#ifndef MSG_INFO_PRINT_COUNT #ifndef MSG_INFO_PRINT_COUNT
@ -1047,6 +1047,9 @@
#ifndef MSG_FILAMENT_CHANGE_NOZZLE #ifndef MSG_FILAMENT_CHANGE_NOZZLE
#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ")
#endif #endif
#ifndef MSG_RUNOUT_SENSOR_ENABLE
#define MSG_RUNOUT_SENSOR_ENABLE _UxGT("Runout Sensor")
#endif
#ifndef MSG_ERR_HOMING_FAILED #ifndef MSG_ERR_HOMING_FAILED
#define MSG_ERR_HOMING_FAILED _UxGT("Homing failed") #define MSG_ERR_HOMING_FAILED _UxGT("Homing failed")
#endif #endif

8
Marlin/src/lcd/ultralcd.cpp

@ -71,6 +71,10 @@
#include "../feature/leds/leds.h" #include "../feature/leds/leds.h"
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#include "../feature/runout.h"
#endif
#if DISABLED(LCD_USE_I2C_BUZZER) #if DISABLED(LCD_USE_I2C_BUZZER)
#include "../libs/buzzer.h" #include "../libs/buzzer.h"
#endif #endif
@ -3428,6 +3432,10 @@ void lcd_quick_feedback(const bool clear_buttons) {
MENU_ITEM(submenu, MSG_BLTOUCH, bltouch_menu); MENU_ITEM(submenu, MSG_BLTOUCH, bltouch_menu);
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
MENU_ITEM_EDIT(bool, MSG_RUNOUT_SENSOR_ENABLE, &runout.enabled);
#endif
#if DISABLED(SLIM_LCD_MENUS) #if DISABLED(SLIM_LCD_MENUS)
// Preheat configurations // Preheat configurations
MENU_ITEM(submenu, MSG_PREHEAT_1_SETTINGS, lcd_configuration_temperature_preheat_material1_settings_menu); MENU_ITEM(submenu, MSG_PREHEAT_1_SETTINGS, lcd_configuration_temperature_preheat_material1_settings_menu);

Loading…
Cancel
Save