|
|
@ -260,33 +260,19 @@ void Endstops::poll() { |
|
|
|
void Endstops::enable_globally(const bool onoff) { |
|
|
|
enabled_globally = enabled = onoff; |
|
|
|
|
|
|
|
#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) |
|
|
|
update(); |
|
|
|
#endif |
|
|
|
update(); |
|
|
|
} |
|
|
|
|
|
|
|
// Enable / disable endstop checking
|
|
|
|
void Endstops::enable(const bool onoff) { |
|
|
|
enabled = onoff; |
|
|
|
|
|
|
|
#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) |
|
|
|
update(); |
|
|
|
#endif |
|
|
|
update(); |
|
|
|
} |
|
|
|
|
|
|
|
// Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable
|
|
|
|
void Endstops::not_homing() { |
|
|
|
enabled = enabled_globally; |
|
|
|
|
|
|
|
// Still 'enabled'? Then endstops are always on and kept in sync.
|
|
|
|
// Otherwise reset 'live's variables to let axes move in both directions.
|
|
|
|
if (!enabled) { |
|
|
|
#if ENDSTOP_NOISE_THRESHOLD |
|
|
|
endstop_poll_count = 0; // Stop filtering (MUST be done first to prevent race condition)
|
|
|
|
validated_live_state = 0; |
|
|
|
#endif |
|
|
|
live_state = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#if ENABLED(VALIDATE_HOMING_ENDSTOPS) |
|
|
@ -302,9 +288,7 @@ void Endstops::not_homing() { |
|
|
|
void Endstops::enable_z_probe(const bool onoff) { |
|
|
|
z_probe_enabled = onoff; |
|
|
|
|
|
|
|
#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) |
|
|
|
update(); |
|
|
|
#endif |
|
|
|
update(); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|