More tweaks. Removed dry run. Trimmed all messages to save flash space.

- Removed the dry run switch. It was getting overly complicated for
what it needed to do. In practice, single block mode and feed rate
overrides (coming in next release) does a much better job with dry runs
than 'dry run'.

- Trimmed all of Grbl's messages from help, status, feedback to
settings. Saved 0.6KB+ of flash space that could be used for v0.9
features.

- Removed some settings inits when set. Will depend on user to power
cycle to get some of these to reload.

- Fixed a bug with settings version not re-writing old settings, when
it should. Thanks Alden!
This commit is contained in:
Sonny Jeon
2012-11-07 20:53:03 -07:00
parent e2e794af45
commit 5e7a4b3ba8
8 changed files with 97 additions and 147 deletions

9
main.c
View File

@ -46,6 +46,7 @@ int main(void)
{
// Initialize system
serial_init(BAUD_RATE); // Setup serial baud rate and interrupts
settings_init(); // Load grbl settings from EEPROM
st_init(); // Setup stepper pins and interrupt timers
sei(); // Enable interrupts
@ -62,7 +63,6 @@ int main(void)
// Reset system.
serial_reset_read_buffer(); // Clear serial read buffer
settings_init(); // Load grbl settings from EEPROM
plan_init(); // Clear block buffer and planner variables
gc_init(); // Set g-code parser to default state
protocol_init(); // Clear incoming line data and execute startup lines
@ -83,10 +83,9 @@ int main(void)
sys.abort = false;
sys.execute = 0;
if (sys.state == STATE_ALARM && bit_istrue(settings.flags,BITFLAG_HOMING_ENABLE)) {
// If a critical event has occurred, set the position lost system state. For example, a
// hard limit event can cause the stepper to lose steps and position due to an immediate
// stop, not with a controlled deceleration. Or, if an abort was issued while a cycle
// was active, the immediate stop can also cause lost steps.
// Position has either been lost from a critical event or a power cycle reboot. If
// homing is enabled, force user to home to get machine position. Otherwise, let the
// user manage position on their own.
report_feedback_message(MESSAGE_HOMING_ALARM);
} else {
sys.state = STATE_IDLE;