From bc21ecdef077cd88cd9dd20b4250504aa35cff8a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 27 Mar 2022 19:46:47 -0500 Subject: [PATCH] Extend enum --- Marlin/src/feature/runout.h | 12 ++++++++---- Marlin/src/lcd/menu/menu_advanced.cpp | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index 3149a21d37..8002be156d 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -63,9 +63,13 @@ extern FilamentMonitor runout; enum RunoutMode : uint8_t { RM_NONE, - RM_ACTIVE_LOW, - RM_ACTIVE_HIGH, - RM_MOTION_SENSOR = 7 + RM_OUT_ON_LOW, + RM_OUT_ON_HIGH, + RM_RESERVED3, + RM_RESERVED4, + RM_RESERVED5, + RM_RESERVED6, + RM_MOTION_SENSOR }; class FilamentMonitorBase { @@ -73,7 +77,7 @@ class FilamentMonitorBase { static bool enabled[NUM_RUNOUT_SENSORS], filament_ran_out; static RunoutMode mode[NUM_RUNOUT_SENSORS]; - static uint8_t out_state(const uint8_t e=0) { return mode[e] == RM_ACTIVE_HIGH ? HIGH : LOW; } + static uint8_t out_state(const uint8_t e=0) { return mode[e] == RM_OUT_ON_HIGH ? HIGH : LOW; } #if ENABLED(HOST_ACTION_COMMANDS) static bool host_handling; diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 8240f5e4ae..ecee97fce7 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -103,8 +103,8 @@ void menu_backlash(); #if HAS_FILAMENT_SENSOR void set_runout_mode_none(const uint8_t e) { runout.mode[e] = RM_NONE; } - void set_runout_mode_high(const uint8_t e) { runout.mode[e] = RM_ACTIVE_HIGH; } - void set_runout_mode_low(const uint8_t e) { runout.mode[e] = RM_ACTIVE_LOW; } + void set_runout_mode_high(const uint8_t e) { runout.mode[e] = RM_OUT_ON_HIGH; } + void set_runout_mode_low(const uint8_t e) { runout.mode[e] = RM_OUT_ON_LOW; } void set_runout_mode_motion(const uint8_t e) { runout.mode[e] = RM_MOTION_SENSOR; } #define RUNOUT_EDIT_ITEMS(F) do{ \