diff --git a/gcode.c b/gcode.c index 29b9b80..35a3f4a 100644 --- a/gcode.c +++ b/gcode.c @@ -150,12 +150,12 @@ uint8_t gc_execute_line(char *line) { if (line[0] == '$') { // Parameter lines are on the form '$4=374.3' or '$' to dump current settings char_counter = 1; - if(line[char_counter] == 0) { dump_settings(); return(GCSTATUS_OK); } + if(line[char_counter] == 0) { settings_dump(); return(GCSTATUS_OK); } read_double(line, &char_counter, &p); if(line[char_counter++] != '=') { return(GCSTATUS_UNSUPPORTED_STATEMENT); } read_double(line, &char_counter, &value); if(line[char_counter] != 0) { return(GCSTATUS_UNSUPPORTED_STATEMENT); } - store_setting(p, value); + settings_store_setting(p, value); } /* We'll handle this as g-code. First: parse all statements */ diff --git a/settings.c b/settings.c index f72c7cd..96ba201 100644 --- a/settings.c +++ b/settings.c @@ -39,7 +39,7 @@ typedef struct { double mm_per_arc_segment; } settings_v1_t; -void reset_settings() { +void settings_reset() { settings.steps_per_mm[0] = DEFAULT_X_STEPS_PER_MM; settings.steps_per_mm[1] = DEFAULT_Y_STEPS_PER_MM; settings.steps_per_mm[2] = DEFAULT_Z_STEPS_PER_MM; @@ -52,7 +52,7 @@ void reset_settings() { settings.max_jerk = DEFAULT_MAX_JERK; } -void dump_settings() { +void settings_dump() { printPgmString(PSTR("$0 = ")); printFloat(settings.steps_per_mm[0]); printPgmString(PSTR(" (steps/mm x)\r\n$1 = ")); printFloat(settings.steps_per_mm[1]); printPgmString(PSTR(" (steps/mm y)\r\n$2 = ")); printFloat(settings.steps_per_mm[2]); @@ -96,7 +96,7 @@ int read_settings() { } // A helper method to set settings from command line -void store_setting(int parameter, double value) { +void settings_store_setting(int parameter, double value) { switch(parameter) { case 0: case 1: case 2: settings.steps_per_mm[parameter] = value; break; @@ -121,8 +121,8 @@ void settings_init() { printPgmString(PSTR("'$' to dump current settings\r\n")); } else { printPgmString(PSTR("Warning: Failed to read EEPROM settings. Using defaults.\r\n")); - reset_settings(); + settings_reset(); write_settings(); - dump_settings(); + settings_dump(); } } diff --git a/settings.h b/settings.h index 35ddd76..5831e0f 100644 --- a/settings.h +++ b/settings.h @@ -49,10 +49,10 @@ extern settings_t settings; void settings_init(); // Print current settings -void dump_settings(); +void settings_dump(); // A helper method to set new settings from command line -void store_setting(int parameter, double value); +void settings_store_setting(int parameter, double value); // Default settings (used when resetting eeprom-settings) #define MICROSTEPS 8