Minor bug fixes.

- Bug fix for step and direction invert masks not immediately being in
effect. Now regenerates the masks when a user changes this setting.

- Bug fix for probing cycle. G-code standard mandates that there is an
error if the probe is already triggered when the cycle is commanded.
However, Grbl may have motions to pull off a previous probing cycle in
queue and can falsely lead to errors. To fix this, the triggered check
is performed within the probing cycle itself, right after the planner
buffer is synced. If there is an error, it will now alarm out as a
probe fail.
This commit is contained in:
Sonny Jeon
2014-08-01 08:29:35 -06:00
parent a396adf60e
commit 5c0d311d92
9 changed files with 41 additions and 17 deletions

View File

@ -439,6 +439,19 @@ ISR(TIMER0_OVF_vect)
#endif
// Generates the step and direction port invert masks used in the Stepper Interrupt Driver.
void st_generate_step_dir_invert_masks()
{
uint8_t idx;
step_port_invert_mask = 0;
dir_port_invert_mask = 0;
for (idx=0; idx<N_AXIS; idx++) {
if (bit_istrue(settings.step_invert_mask,bit(idx))) { step_port_invert_mask |= get_step_pin_mask(idx); }
if (bit_istrue(settings.dir_invert_mask,bit(idx))) { dir_port_invert_mask |= get_direction_pin_mask(idx); }
}
}
// Reset and clear stepper subsystem variables
void st_reset()
{
@ -455,14 +468,7 @@ void st_reset()
segment_next_head = 1;
busy = false;
// Setup step and direction port invert masks.
uint8_t idx;
step_port_invert_mask = 0;
dir_port_invert_mask = 0;
for (idx=0; idx<N_AXIS; idx++) {
if (bit_istrue(settings.step_invert_mask,bit(idx))) { step_port_invert_mask |= get_step_pin_mask(idx); }
if (bit_istrue(settings.dir_invert_mask,bit(idx))) { dir_port_invert_mask |= get_direction_pin_mask(idx); }
}
st_generate_step_dir_invert_masks();
// Initialize step and direction port pins.
STEP_PORT = (STEP_PORT & ~STEP_MASK) | step_port_invert_mask;