Permalink
Browse files

Pushed minor changes. Thanks @Protoneer!

  • Loading branch information...
1 parent 97d18f0 commit aae1089051367091ed9551d4c5aa942d9298c855 @chamnit chamnit committed Mar 13, 2013
Showing with 11 additions and 7 deletions.
  1. +1 −1 eeprom.h
  2. +10 −6 gcode.c
View
@@ -2,7 +2,7 @@
#define eeprom_h
char eeprom_get_char(unsigned int addr);
-void eeprom_put_char(unsigned int addr, char new_value);
+void eeprom_put_char(unsigned int addr, unsigned char new_value);
void memcpy_to_eeprom_with_checksum(unsigned int destination, char *source, unsigned int size);
int memcpy_from_eeprom_with_checksum(char *destination, unsigned int source, unsigned int size);
View
16 gcode.c
@@ -325,17 +325,21 @@ uint8_t gc_execute_line(char *line)
}
// Retreive G28/30 go-home position data (in machine coordinates) from EEPROM
float coord_data[N_AXIS];
- uint8_t home_select = SETTING_INDEX_G28;
- if (non_modal_action == NON_MODAL_GO_HOME_1) { home_select = SETTING_INDEX_G30; }
- if (!settings_read_coord_data(home_select,coord_data)) { return(STATUS_SETTING_READ_FAIL); }
+ if (non_modal_action == NON_MODAL_GO_HOME_0) {
+ if (!settings_read_coord_data(SETTING_INDEX_G28,coord_data)) { return(STATUS_SETTING_READ_FAIL); }
+ } else {
+ if (!settings_read_coord_data(SETTING_INDEX_G30,coord_data)) { return(STATUS_SETTING_READ_FAIL); }
+ }
mc_line(coord_data[X_AXIS], coord_data[Y_AXIS], coord_data[Z_AXIS], -1.0, false);
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.
break;
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) { home_select = SETTING_INDEX_G30; }
- settings_write_coord_data(home_select,gc.position);
+ if (non_modal_action == NON_MODAL_SET_HOME_0) {
+ settings_write_coord_data(SETTING_INDEX_G28,gc.position);
+ } else {
+ settings_write_coord_data(SETTING_INDEX_G30,gc.position);
+ }
break;
case NON_MODAL_SET_COORDINATE_OFFSET:
if (!axis_words) { // No axis words

0 comments on commit aae1089

Please sign in to comment.