M591Fixes
This commit is contained in:
@@ -210,6 +210,7 @@ class FilamentSensorBase {
|
||||
#undef _INIT_RUNOUT_PIN
|
||||
#undef INIT_RUNOUT_PIN
|
||||
}
|
||||
|
||||
|
||||
// Return a bitmask of runout pin states
|
||||
static uint8_t poll_runout_pins() {
|
||||
@@ -220,7 +221,7 @@ class FilamentSensorBase {
|
||||
|
||||
// Return a bitmask of runout flag states (1 bits always indicates runout)
|
||||
static uint8_t poll_runout_states() {
|
||||
#define _OR_INVERT(N) | (runout.out_state(N) ? 0 : _BV(N))
|
||||
#define _OR_INVERT(N) | (runout.out_state(N-1) ? 0 : _BV(N-1))
|
||||
return poll_runout_pins() ^ uint8_t(0 REPEAT_1(NUM_RUNOUT_SENSORS, _OR_INVERT));
|
||||
#undef _OR_INVERT
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void GcodeSuite::M591() {
|
||||
case RM_NONE ... RM_OUT_ON_HIGH:
|
||||
case RM_MOTION_SENSOR:
|
||||
runout.mode[tool] = tmp_mode;
|
||||
runout.reset();
|
||||
runout.setup();
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,10 +99,10 @@ 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_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; }
|
||||
void set_runout_mode_none(const uint8_t e) { runout.mode[e] = RM_NONE; runout.setup(); }
|
||||
void set_runout_mode_high(const uint8_t e) { runout.mode[e] = RM_OUT_ON_HIGH; runout.setup(); }
|
||||
void set_runout_mode_low(const uint8_t e) { runout.mode[e] = RM_OUT_ON_LOW; runout.setup(); }
|
||||
void set_runout_mode_motion(const uint8_t e) { runout.mode[e] = RM_MOTION_SENSOR; runout.setup(); }
|
||||
|
||||
#define RUNOUT_EDIT_ITEMS(F) do{ \
|
||||
EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled[F]); \
|
||||
|
||||
Reference in New Issue
Block a user