report probe_succeeded with probe status
This commit is contained in:
parent
0beacbbb11
commit
297f4d1dd6
@ -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
|
||||
|
5
probe.c
5
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
probe.h
2
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.
|
||||
|
2
report.c
2
report.c
@ -236,6 +236,8 @@ void report_probe_parameters()
|
||||
printFloat_CoordValue(print_position[i]);
|
||||
if (i < (N_AXIS-1)) { printPgmString(PSTR(",")); }
|
||||
}
|
||||
printPgmString(PSTR(":"));
|
||||
print_uint8_base10(sys.probe_succeeded);
|
||||
printPgmString(PSTR("]\r\n"));
|
||||
}
|
||||
|
||||
|
1
system.h
1
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user