Limit pin internal pull-resistors enabled. Re-wrote read_double() function. Correctly changed all 'double's to 'float's.
- Limit pin internal pull-resistors now enabled. Normal high operation. This will be the standard going forward. - Updated all of the 'double' variable types to 'float' to reflect what happens when compiled for the Arduino. Also done for compatibility reasons to @jgeisler0303 's Grbl simulator code. - G-code parser will now ignore 'E' exponent values, since they are reserved g-code characters for some machines. Thanks @csdexter! - The read_double() function was re-written and optimized for use in Grbl. The strtod() avr lib was removed.
This commit is contained in:
16
settings.c
16
settings.c
@ -33,13 +33,13 @@ settings_t settings;
|
||||
|
||||
// Version 1 outdated settings record
|
||||
typedef struct {
|
||||
double steps_per_mm[3];
|
||||
float steps_per_mm[3];
|
||||
uint8_t microsteps;
|
||||
uint8_t pulse_microseconds;
|
||||
double default_feed_rate;
|
||||
double default_seek_rate;
|
||||
float default_feed_rate;
|
||||
float default_seek_rate;
|
||||
uint8_t invert_mask;
|
||||
double mm_per_arc_segment;
|
||||
float mm_per_arc_segment;
|
||||
} settings_v1_t;
|
||||
|
||||
// Default settings (used when resetting eeprom-settings)
|
||||
@ -89,20 +89,20 @@ void settings_dump() {
|
||||
// Parameter lines are on the form '$4=374.3' or '$' to dump current settings
|
||||
uint8_t settings_execute_line(char *line) {
|
||||
uint8_t char_counter = 1;
|
||||
double parameter, value;
|
||||
float parameter, value;
|
||||
if(line[0] != '$') {
|
||||
return(STATUS_UNSUPPORTED_STATEMENT);
|
||||
}
|
||||
if(line[char_counter] == 0) {
|
||||
settings_dump(); return(STATUS_OK);
|
||||
}
|
||||
if(!read_double(line, &char_counter, ¶meter)) {
|
||||
if(!read_float(line, &char_counter, ¶meter)) {
|
||||
return(STATUS_BAD_NUMBER_FORMAT);
|
||||
};
|
||||
if(line[char_counter++] != '=') {
|
||||
return(STATUS_UNSUPPORTED_STATEMENT);
|
||||
}
|
||||
if(!read_double(line, &char_counter, &value)) {
|
||||
if(!read_float(line, &char_counter, &value)) {
|
||||
return(STATUS_BAD_NUMBER_FORMAT);
|
||||
}
|
||||
if(line[char_counter] != 0) {
|
||||
@ -158,7 +158,7 @@ int read_settings() {
|
||||
}
|
||||
|
||||
// A helper method to set settings from command line
|
||||
void settings_store_setting(int parameter, double value) {
|
||||
void settings_store_setting(int parameter, float value) {
|
||||
switch(parameter) {
|
||||
case 0: case 1: case 2:
|
||||
if (value <= 0.0) {
|
||||
|
Reference in New Issue
Block a user