Update gcode.c
Removed the home_select variable.
This commit is contained in:
parent
5ecc661ec8
commit
8e01fed143
20
gcode.c
20
gcode.c
@ -271,8 +271,6 @@ uint8_t gc_execute_line(char *line)
|
|||||||
// [G4,G10,G28,G30,G92,G92.1]: Perform dwell, set coordinate system data, homing, or set axis offsets.
|
// [G4,G10,G28,G30,G92,G92.1]: Perform dwell, set coordinate system data, homing, or set axis offsets.
|
||||||
// NOTE: These commands are in the same modal group, hence are mutually exclusive. G53 is in this
|
// NOTE: These commands are in the same modal group, hence are mutually exclusive. G53 is in this
|
||||||
// modal group and do not effect these actions.
|
// modal group and do not effect these actions.
|
||||||
uint8_t home_select;
|
|
||||||
|
|
||||||
switch (non_modal_action) {
|
switch (non_modal_action) {
|
||||||
case NON_MODAL_DWELL:
|
case NON_MODAL_DWELL:
|
||||||
if (p < 0) { // Time cannot be negative.
|
if (p < 0) { // Time cannot be negative.
|
||||||
@ -330,18 +328,22 @@ uint8_t gc_execute_line(char *line)
|
|||||||
}
|
}
|
||||||
// Retreive G28/30 go-home position data (in machine coordinates) from EEPROM
|
// Retreive G28/30 go-home position data (in machine coordinates) from EEPROM
|
||||||
float coord_data[N_AXIS];
|
float coord_data[N_AXIS];
|
||||||
home_select = SETTING_INDEX_G28;
|
if (non_modal_action == NON_MODAL_GO_HOME_1) {
|
||||||
if (non_modal_action == NON_MODAL_GO_HOME_1) { home_select = SETTING_INDEX_G30; }
|
if (!settings_read_coord_data(SETTING_INDEX_G30 ,coord_data)) { return(STATUS_SETTING_READ_FAIL); }
|
||||||
if (!settings_read_coord_data(home_select,coord_data)) { return(STATUS_SETTING_READ_FAIL); }
|
} else {
|
||||||
|
if (!settings_read_coord_data(SETTING_INDEX_G28 ,coord_data)) { return(STATUS_SETTING_READ_FAIL); }
|
||||||
|
}
|
||||||
mc_line(coord_data[X_AXIS], coord_data[Y_AXIS], coord_data[Z_AXIS], settings.default_seek_rate, false);
|
mc_line(coord_data[X_AXIS], coord_data[Y_AXIS], coord_data[Z_AXIS], settings.default_seek_rate, false);
|
||||||
memcpy(gc.position, coord_data, sizeof(coord_data)); // gc.position[] = coord_data[];
|
memcpy(gc.position, coord_data, sizeof(coord_data)); // gc.position[] = coord_data[];
|
||||||
axis_words = 0; // Axis words used. Lock out from motion modes by clearing flags.
|
axis_words = 0; // Axis words used. Lock out from motion modes by clearing flags.
|
||||||
break;
|
break;
|
||||||
case NON_MODAL_SET_HOME_0: case NON_MODAL_SET_HOME_1:
|
case NON_MODAL_SET_HOME_0: case NON_MODAL_SET_HOME_1:
|
||||||
home_select = SETTING_INDEX_G28;
|
if (non_modal_action == NON_MODAL_SET_HOME_1) {
|
||||||
if (non_modal_action == NON_MODAL_SET_HOME_1) { home_select = SETTING_INDEX_G30; }
|
settings_write_coord_data(SETTING_INDEX_G30,gc.position);
|
||||||
settings_write_coord_data(home_select,gc.position);
|
} else {
|
||||||
break;
|
settings_write_coord_data(SETTING_INDEX_G28,gc.position);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case NON_MODAL_SET_COORDINATE_OFFSET:
|
case NON_MODAL_SET_COORDINATE_OFFSET:
|
||||||
if (!axis_words) { // No axis words
|
if (!axis_words) { // No axis words
|
||||||
FAIL(STATUS_INVALID_STATEMENT);
|
FAIL(STATUS_INVALID_STATEMENT);
|
||||||
|
Loading…
Reference in New Issue
Block a user