static stat_t _probing_finish() { int8_t probe = gpio_read_input(pb.probe_input); cm.probe_state = (probe==true) ? PROBE_SUCCEEDED : PROBE_FAILED; for (uint8_t axis=0; axis<AXES; axis++ ) { // if we got here because of a feed hold we need to keep the model position correct cm_set_position(axis, cm_get_work_position(RUNTIME, axis)); // store the probe results cm.probe_results[axis] = cm_get_absolute_position(ACTIVE_MODEL, axis); } // If probe was successful the 'e' word == 1, otherwise e == 0 to signal an error printf_P(PSTR("{\"prb\":{\"e\":%i"), (int)cm.probe_state); if (fp_TRUE(pb.flags[AXIS_X])) printf_P(PSTR(",\"x\":%0.3f"), cm.probe_results[AXIS_X]); if (fp_TRUE(pb.flags[AXIS_Y])) printf_P(PSTR(",\"y\":%0.3f"), cm.probe_results[AXIS_Y]); if (fp_TRUE(pb.flags[AXIS_Z])) printf_P(PSTR(",\"z\":%0.3f"), cm.probe_results[AXIS_Z]); if (fp_TRUE(pb.flags[AXIS_A])) printf_P(PSTR(",\"a\":%0.3f"), cm.probe_results[AXIS_A]); if (fp_TRUE(pb.flags[AXIS_B])) printf_P(PSTR(",\"b\":%0.3f"), cm.probe_results[AXIS_B]); if (fp_TRUE(pb.flags[AXIS_C])) printf_P(PSTR(",\"c\":%0.3f"), cm.probe_results[AXIS_C]); printf_P(PSTR("}}\n")); return (_set_pb_func(_probing_finalize_exit)); }
static stat_t _homing_axis_set_zero(int8_t axis) // set zero and finish up { if (hm.set_coordinates != false) { // do not set axis if in G28.4 cycle cm_set_position(axis, 0); cm.homed[axis] = true; } else { cm_set_position(axis, cm_get_work_position(RUNTIME, axis)); } cm.a[axis].jerk_max = hm.saved_jerk; // restore the max jerk value #ifdef __NEW_SWITCHES switch_t *s = &sw.s[hm.homing_switch_axis][hm.homing_switch_position]; s->on_trailing = hm.switch_saved_on_trailing; _restore_switch_settings(&sw.s[hm.homing_switch_axis][hm.homing_switch_position]); #endif return (_set_homing_func(_homing_axis_start)); }