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:
Sonny Jeon
2012-10-21 19:18:24 -06:00
parent 909feb7f79
commit 065ceceb34
9 changed files with 103 additions and 94 deletions

View File

@ -26,8 +26,7 @@
#include <avr/sleep.h>
#include "serial.h"
#include "config.h"
#include "stepper.h"
#include "spindle_control.h"
#include "motion_control.h"
#include "nuts_bolts.h"
#include "protocol.h"
@ -166,16 +165,8 @@ ISR(USART_RX_vect)
case CMD_CYCLE_START: sys.execute |= EXEC_CYCLE_START; break; // Set as true
case CMD_FEED_HOLD: sys.execute |= EXEC_FEED_HOLD; break; // Set as true
case CMD_RESET:
sys.execute |= EXEC_ALARM; // Set alarm to allow subsystem disable for certain settings.
// TODO: When Grbl system status is installed, set position lost state if the cycle is active.
// if (sys.cycle_start) { POSITION LOST }
// Immediately force stepper and spindle subsystem idle at an interrupt level.
if (!(sys.execute & EXEC_RESET)) { // Force stop only first time.
st_go_idle();
spindle_stop();
}
if (!(sys.execute & EXEC_RESET)) { mc_alarm(); } // Stop only first time.
sys.execute |= EXEC_RESET; // Set as true
break;
default: // Write character to buffer