Skip to content

Commit

Permalink
Make G92 G54-59 G43.1 persistent,
Browse files Browse the repository at this point in the history
This is alternative implementation of the gnea#624 , untested. @dshaded should test it or if hi don't like it close it. 
The gnea#624 implementation have some side effects, and this is the reason i have proposed this. In addition i have included persistency
of G54 to G59 coordinates.
  • Loading branch information
cri-s authored Mar 19, 2019
1 parent bb25d2f commit 2c99deb
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions grbl/gcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@ parser_block_t gc_block;


void gc_init()
{
{ static char init; init&=0x80;
if(!init) { init--;
memset(&gc_state, 0, sizeof(parser_state_t));

// Load default G54 coordinate system.
if (!(settings_read_coord_data(gc_state.modal.coord_select,gc_state.coord_system))) {
report_status_message(STATUS_SETTING_READ_FAIL);
}
if (!(settings_read_coord_data(gc_state.modal.coord_select,gc_state.coord_system)))
report_status_message(STATUS_SETTING_READ_FAIL);
} else {
uint8_t tmp = gc_state.modal.coord_select; // in case more then 64 offsets are used.
if(gc_state.modal.tool_length) init&=0x40;
memset(&gc_state, 0, sizeof(parser_state_t)-sizeof(float)*(N_AXIS*2+1));
gc_state.modal.coord_select=tmp; if(init&0x40) gc_state.modal.tool_length++;
}
}


Expand Down

0 comments on commit 2c99deb

Please sign in to comment.