static stat_t _probing_error_exit(int8_t axis) { // Generate the warning message. Since the error exit returns via the probing callback // - and not the main controller - it requires its own display processing nv_reset_nv_list(); if (axis == -2) { nv_add_conditional_message((const char *)"Probing error - invalid probe destination"); } else { char msg[NV_MESSAGE_LEN]; sprintf_P(msg, PSTR("Probing error - %c axis cannot move during probing"), cm_get_axis_char(axis)); nv_add_conditional_message(msg); } nv_print_list(STAT_PROBE_CYCLE_FAILED, TEXT_INLINE_VALUES, JSON_RESPONSE_FORMAT); // clean up and exit _probe_restore_settings(); return (STAT_PROBE_CYCLE_FAILED); }
static stat_t _homing_error_exit(int8_t axis, stat_t status) { // Generate the warning message. Since the error exit returns via the homing callback // - and not the main controller - it requires its own display processing nv_reset_nv_list(); if (axis == -2) { nv_add_conditional_message((const char_t *)"Homing error - Bad or no axis(es) specified");; } else { char message[NV_MESSAGE_LEN]; sprintf_P(message, PSTR("Homing error - %c axis settings misconfigured"), cm_get_axis_char(axis)); nv_add_conditional_message((char_t *)message); } nv_print_list(STAT_HOMING_CYCLE_FAILED, TEXT_INLINE_VALUES, JSON_RESPONSE_FORMAT); _homing_finalize_exit(axis); return (STAT_HOMING_CYCLE_FAILED); // homing state remains HOMING_NOT_HOMED }
static stat_t _homing_error_exit(int8_t axis) { // Generate the warning message. Since the error exit returns via the homing callback // - and not the main controller - it requires its own display processing cmd_reset_list(); if (axis == -2) { cmd_add_conditional_message((const char_t *)"*** WARNING *** Homing error: Specified axis(es) cannot be homed");; } else { char message[CMD_MESSAGE_LEN]; sprintf_P(message, PSTR("*** WARNING *** Homing error: %c axis settings misconfigured"), cm_get_axis_char(axis)); cmd_add_conditional_message((char_t *)message); } cmd_print_list(STAT_HOMING_CYCLE_FAILED, TEXT_INLINE_VALUES, JSON_RESPONSE_FORMAT); // clean up and exit mp_flush_planner(); // should be stopped, but in case of switch closure // don't use cm_request_queue_flush() here cm_set_coord_system(hm.saved_coord_system); // restore to work coordinate system cm_set_units_mode(hm.saved_units_mode); cm_set_distance_mode(hm.saved_distance_mode); cm_set_feed_rate(hm.saved_feed_rate); cm_set_motion_mode(MODEL, MOTION_MODE_CANCEL_MOTION_MODE); cm.cycle_state = CYCLE_OFF; cm_cycle_end(); return (STAT_HOMING_CYCLE_FAILED); // homing state remains HOMING_NOT_HOMED }