diff --git a/motion_control.c b/motion_control.c index f6b7037..79fd30d 100644 --- a/motion_control.c +++ b/motion_control.c @@ -320,7 +320,7 @@ void mc_homing_cycle() bit_true_atomic(sys.execute, EXEC_CRIT_EVENT); } else { perform_pull_off = 0; - probe_finalize(); + probe_finalize(0); } } protocol_execute_runtime(); // Check and execute run-time commands diff --git a/probe.c b/probe.c index 3623f7b..12fcc63 100644 --- a/probe.c +++ b/probe.c @@ -50,8 +50,9 @@ uint8_t probe_errors_enabled(uint8_t mode) { return !(mode & PROBE_NO_ERROR); } -void probe_finalize() { +void probe_finalize(uint8_t probe_succeeded) { sys.probe_state = PROBE_OFF; + sys.probe_succeeded = probe_succeeded; memcpy(sys.probe_position, sys.position, sizeof(float)*N_AXIS); bit_true(sys.execute, EXEC_FEED_HOLD); } @@ -63,7 +64,7 @@ void probe_state_monitor() { if (sys.probe_state != PROBE_OFF) { if (probe_get_state(sys.probe_state)) { - probe_finalize(); + probe_finalize(1); } } } diff --git a/probe.h b/probe.h index 194e56e..17028eb 100644 --- a/probe.h +++ b/probe.h @@ -40,7 +40,7 @@ uint8_t probe_get_state(uint8_t mode); uint8_t probe_errors_enabled(uint8_t mode); -void probe_finalize(); +void probe_finalize(uint8_t probe_succeeded); // Monitors probe pin state and records the system position when detected. Called by the // stepper ISR per ISR tick. diff --git a/report.c b/report.c index 32720eb..ca93efe 100644 --- a/report.c +++ b/report.c @@ -235,7 +235,9 @@ void report_probe_parameters() print_position[i] = sys.probe_position[i]/settings.steps_per_mm[i]; printFloat_CoordValue(print_position[i]); if (i < (N_AXIS-1)) { printPgmString(PSTR(",")); } - } + } + printPgmString(PSTR(":")); + print_uint8_base10(sys.probe_succeeded); printPgmString(PSTR("]\r\n")); } diff --git a/system.h b/system.h index 93ab2b9..3263af8 100644 --- a/system.h +++ b/system.h @@ -79,6 +79,7 @@ typedef struct { uint8_t auto_start; // Planner auto-start flag. Toggled off during feed hold. Defaulted by settings. volatile uint8_t probe_state; // Probing state value. Used to coordinate the probing cycle with stepper ISR. int32_t probe_position[N_AXIS]; // Last probe position in machine coordinates and steps. + uint8_t probe_succeeded; } system_t; extern system_t sys;