report probe_succeeded with probe status

This commit is contained in:
Elijah Insua 2014-09-22 20:32:47 -07:00
parent 0beacbbb11
commit 297f4d1dd6
5 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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);
}
}
}

View File

@ -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.

View File

@ -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"));
}

View File

@ -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;