New alarm method. Re(re)organized status messages.
- Installed a new 'alarm' method to centralize motion kills across alarm or reset events. Right now, this is controlled by system abort and hard limits. But, in the future, a g-code parser error may call this too as a safety feature. - Re(re)organized status messages to just print all errors, regardless from where it was called. This centralizes them into one place. - Misc messages method installed for any user feedback that is not a confirmation or error. Mainly so that there is a place to perform warnings and such. - New stuff installed and still made the flash size smaller by saving flash space from clearing out repeated '\r\n' pgmstrings. - Fixed a bug where hard limits message would print everytime a system abort was sent.
This commit is contained in:
10
limits.c
10
limits.c
@ -56,16 +56,14 @@ ISR(LIMIT_INT_vect)
|
||||
if (bit_isfalse(sys.execute,EXEC_ALARM)) {
|
||||
// Kill all processes upon hard limit event.
|
||||
if ((LIMIT_PIN & LIMIT_MASK) ^ LIMIT_MASK) {
|
||||
st_go_idle(); // Immediately stop stepper motion
|
||||
spindle_stop(); // Stop spindle
|
||||
sys.auto_start = false; // Disable auto cycle start.
|
||||
sys.execute |= EXEC_ALARM;
|
||||
// TODO: When Grbl system status is installed, update here to indicate loss of position.
|
||||
mc_alarm(); // Initiate system kill.
|
||||
protocol_status_message(STATUS_HARD_LIMIT); // Print ok in interrupt since system killed.
|
||||
}
|
||||
// else {
|
||||
// TODO: When leaving a switch, this interrupt can be activated upon detecting a pin
|
||||
// change to high. If so, need to start a countdown timer to check the pin again after
|
||||
// a debounce period to not falsely re-engage the alarm.
|
||||
// a debounce period to not falsely re-engage the alarm. Not essential, but *could* be
|
||||
// a minor annoyance.
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user