Added restore settings defaults command.

- New restore setting defaults command. Only wipes ‘$$’ setting in
EEPROM and reloads them based on the defaults used when Grbl was
compiled. Used with a `$RST` command

NOTE: `$RST` is intentionally not listed in the Grbl ‘$’ help message.
This commit is contained in:
Sonny Jeon 2015-06-18 09:23:17 -06:00
parent e14cff3ddc
commit 185de02836
7 changed files with 23 additions and 4 deletions

View File

@ -42,7 +42,7 @@ FUSES = -U hfuse:w:0xd2:m -U lfuse:w:0xff:m
# Tune the lines below only if you know what you are doing: # Tune the lines below only if you know what you are doing:
AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) -B 10 -F AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) -B 10 -F
COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -I. -ffunction-sections COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -I. -ffunction-sections -fdata-sections
OBJECTS = $(addprefix $(BUILDDIR)/,$(notdir $(SOURCE:.c=.o))) OBJECTS = $(addprefix $(BUILDDIR)/,$(notdir $(SOURCE:.c=.o)))

View File

@ -1,3 +1,12 @@
----------------
Date: 2015-05-29
Author: Sonny Jeon
Subject: Added G61 exact path support.
- G61 exact path is the Grbl default path control mode, so its now
added as a supported g-code.
---------------- ----------------
Date: 2015-05-27 Date: 2015-05-27
Author: Sonny Jeon Author: Sonny Jeon

View File

@ -23,7 +23,7 @@
// Grbl versioning system // Grbl versioning system
#define GRBL_VERSION "0.9i" #define GRBL_VERSION "0.9i"
#define GRBL_VERSION_BUILD "20150529" #define GRBL_VERSION_BUILD "20150618"
// Define standard libraries used by Grbl. // Define standard libraries used by Grbl.
#include <avr/io.h> #include <avr/io.h>

View File

@ -138,6 +138,8 @@ void report_feedback_message(uint8_t message_code)
printPgmString(PSTR("Check Door")); break; printPgmString(PSTR("Check Door")); break;
case MESSAGE_PROGRAM_END: case MESSAGE_PROGRAM_END:
printPgmString(PSTR("Pgm End")); break; printPgmString(PSTR("Pgm End")); break;
case MESSAGE_RESTORE_DEFAULTS:
printPgmString(PSTR("Restoring defaults")); break;
} }
printPgmString(PSTR("]\r\n")); printPgmString(PSTR("]\r\n"));
} }

View File

@ -69,6 +69,7 @@
#define MESSAGE_DISABLED 5 #define MESSAGE_DISABLED 5
#define MESSAGE_SAFETY_DOOR_AJAR 6 #define MESSAGE_SAFETY_DOOR_AJAR 6
#define MESSAGE_PROGRAM_END 7 #define MESSAGE_PROGRAM_END 7
#define MESSAGE_RESTORE_DEFAULTS 8
// Prints system status messages. // Prints system status messages.
void report_status_message(uint8_t status_code); void report_status_message(uint8_t status_code);

View File

@ -101,7 +101,7 @@ void settings_init();
// Helper functions to clear and restore EEPROM defaults // Helper functions to clear and restore EEPROM defaults
void settings_restore_global_settings(); void settings_restore_global_settings();
void settings_clear_parameters(); void settings_clear_parameters();
void settings_clear_startup_line(); void settings_clear_startup_lines();
void settings_clear_build_info(); void settings_clear_build_info();
// A helper method to set new settings from command line // A helper method to set new settings from command line

View File

@ -201,6 +201,13 @@ uint8_t system_execute_line(char *line)
settings_store_build_info(line); settings_store_build_info(line);
} }
break; break;
case 'R' : // Restore defaults [IDLE/ALARM]
if (line[++char_counter] != 'S') { return(STATUS_INVALID_STATEMENT); }
if (line[++char_counter] != 'T') { return(STATUS_INVALID_STATEMENT); }
if (line[++char_counter] != 0) { return(STATUS_INVALID_STATEMENT); }
report_feedback_message(MESSAGE_RESTORE_DEFAULTS);
settings_restore_global_settings();
break;
case 'N' : // Startup lines. [IDLE/ALARM] case 'N' : // Startup lines. [IDLE/ALARM]
if ( line[++char_counter] == 0 ) { // Print startup lines if ( line[++char_counter] == 0 ) { // Print startup lines
for (helper_var=0; helper_var < N_STARTUP_LINE; helper_var++) { for (helper_var=0; helper_var < N_STARTUP_LINE; helper_var++) {