mirror of
https://github.com/grblHAL/core.git
synced 2026-02-05 16:50:16 +08:00
More fixes for issue #332: setting tool table data cleared current coordinate system offset, incomplete handling of G10 L10 and L11.
Added free memory to $I output when available, example: [FREE MEMORY:102K] Changed reported position for failed probe to target. Parameters #5061 - #5069 returns position in coordinate system used when probing.
This commit is contained in:
@@ -944,10 +944,19 @@ status_code_t mc_homing_cycle (axes_signals_t cycle)
|
||||
// NOTE: Upon probe failure, the program will be stopped and placed into ALARM state.
|
||||
gc_probe_t mc_probe_cycle (float *target, plan_line_data_t *pl_data, gc_parser_flags_t parser_flags)
|
||||
{
|
||||
uint_fast8_t idx = N_AXIS;
|
||||
|
||||
// TODO: Need to update this cycle so it obeys a non-auto cycle start.
|
||||
if (state_get() == STATE_CHECK_MODE)
|
||||
return GCProbe_CheckMode;
|
||||
|
||||
do {
|
||||
idx--;
|
||||
sys.probe_position[idx] = lroundf(target[idx] * settings.axis[idx].steps_per_mm);
|
||||
} while(idx);
|
||||
|
||||
sys.probe_coordsys_id = gc_state.modal.coord_system.id;
|
||||
|
||||
// Finish all queued commands and empty planner buffer before starting probe cycle.
|
||||
if (!protocol_buffer_synchronize())
|
||||
return GCProbe_Abort; // Return if system reset has been issued.
|
||||
@@ -1007,16 +1016,12 @@ gc_probe_t mc_probe_cycle (float *target, plan_line_data_t *pl_data, gc_parser_f
|
||||
// Probing cycle complete!
|
||||
|
||||
// Set state variables and error out, if the probe failed and cycle with error is enabled.
|
||||
if (sys.probing_state == Probing_Active) {
|
||||
if (parser_flags.probe_is_no_error)
|
||||
memcpy(sys.probe_position, sys.position, sizeof(sys.position));
|
||||
else
|
||||
if(sys.probing_state == Probing_Active) {
|
||||
memcpy(sys.probe_position, sys.position, sizeof(sys.position));
|
||||
if(!parser_flags.probe_is_no_error)
|
||||
system_set_exec_alarm(Alarm_ProbeFailContact);
|
||||
} else {
|
||||
// Indicate to system the probing cycle completed successfully.
|
||||
sys.probe_coordsys_id = gc_state.modal.coord_system.id;
|
||||
sys.flags.probe_succeeded = On;
|
||||
}
|
||||
} else
|
||||
sys.flags.probe_succeeded = On; // Indicate to system the probing cycle completed successfully.
|
||||
|
||||
sys.probing_state = Probing_Off; // Ensure probe state monitor is disabled.
|
||||
hal.probe.configure(false, false); // Re-initialize invert mask.
|
||||
|
||||
Reference in New Issue
Block a user