|
@ -260,33 +260,19 @@ void Endstops::poll() { |
|
|
void Endstops::enable_globally(const bool onoff) { |
|
|
void Endstops::enable_globally(const bool onoff) { |
|
|
enabled_globally = enabled = onoff; |
|
|
enabled_globally = enabled = onoff; |
|
|
|
|
|
|
|
|
#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) |
|
|
update(); |
|
|
update(); |
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Enable / disable endstop checking
|
|
|
// Enable / disable endstop checking
|
|
|
void Endstops::enable(const bool onoff) { |
|
|
void Endstops::enable(const bool onoff) { |
|
|
enabled = onoff; |
|
|
enabled = onoff; |
|
|
|
|
|
|
|
|
#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) |
|
|
update(); |
|
|
update(); |
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable
|
|
|
// Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable
|
|
|
void Endstops::not_homing() { |
|
|
void Endstops::not_homing() { |
|
|
enabled = enabled_globally; |
|
|
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) |
|
|
#if ENABLED(VALIDATE_HOMING_ENDSTOPS) |
|
@ -302,9 +288,7 @@ void Endstops::not_homing() { |
|
|
void Endstops::enable_z_probe(const bool onoff) { |
|
|
void Endstops::enable_z_probe(const bool onoff) { |
|
|
z_probe_enabled = onoff; |
|
|
z_probe_enabled = onoff; |
|
|
|
|
|
|
|
|
#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) |
|
|
update(); |
|
|
update(); |
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|