Merge pull request #494 from ashelly/homing-alarm
Alarm if limits engaged on homing start.
This commit is contained in:
commit
041109410a
1 changed files with 12 additions and 0 deletions
|
|
@ -240,6 +240,18 @@ void mc_dwell(float seconds)
|
|||
// executing the homing cycle. This prevents incorrect buffered plans after homing.
|
||||
void mc_homing_cycle()
|
||||
{
|
||||
uint8_t limits_on;
|
||||
if (bit_istrue(settings.flags,BITFLAG_INVERT_LIMIT_PINS)) {
|
||||
limits_on = ((~LIMIT_PIN) & LIMIT_MASK);
|
||||
} else {
|
||||
limits_on = (LIMIT_PIN & LIMIT_MASK);
|
||||
}
|
||||
if (limits_on) {
|
||||
mc_reset(); // Issue system reset and ensure spindle and coolant are shutdown.
|
||||
bit_true_atomic(sys.execute, (EXEC_ALARM | EXEC_CRIT_EVENT)); // Indicate homing limit critical event
|
||||
return;
|
||||
}
|
||||
|
||||
sys.state = STATE_HOMING; // Set system state variable
|
||||
limits_disable(); // Disable hard limits pin change register for cycle duration
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue