Extend enum
This commit is contained in:
committed by
InsanityAutomation
parent
b7ddd541c9
commit
bc21ecdef0
@@ -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;
|
||||
|
||||
@@ -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{ \
|
||||
|
||||
Reference in New Issue
Block a user