From: Joseph Coffland Date: Tue, 29 Mar 2016 12:26:55 +0000 (-0700) Subject: Cleaned up unused status messages X-Git-Url: https://git.buildbotics.com/?a=commitdiff_plain;h=1fd1148739f30a0ac61073de3b0aa05f6c4152e9;p=bbctrl-firmware Cleaned up unused status messages --- diff --git a/src/hardware.h b/src/hardware.h index 7e510d8..9392de0 100644 --- a/src/hardware.h +++ b/src/hardware.h @@ -31,6 +31,8 @@ #include "status.h" +#include + void hardware_init(); void hw_request_hard_reset(); diff --git a/src/messages.def b/src/messages.def index 355e7f6..a7d5bd3 100644 --- a/src/messages.def +++ b/src/messages.def @@ -28,276 +28,52 @@ // Must keep these aligned with defs in status.h MSG(00, "OK") -MSG(01, "Error") -MSG(02, "Eagain") -MSG(03, "Noop") -MSG(04, "Complete") -MSG(05, "Terminated") -MSG(06, "Hard reset") -MSG(07, "End of line") -MSG(08, "End of file") -MSG(09, "File not open") - -MSG(10, "Max file size exceeded") -MSG(11, "No such device") -MSG(12, "Buffer empty") -MSG(13, "Buffer full") -MSG(14, "Buffer full - fatal") -MSG(15, "Initializing") -MSG(16, "Entering boot loader") -MSG(17, "Function is stubbed") -MSG(18, "EEPROM data invalid") -MSG(19, "19") - -MSG(20, "Internal error") -MSG(21, "Internal range error") -MSG(22, "Floating point error") -MSG(23, "Divide by zero") -MSG(24, "Invalid Address") -MSG(25, "Read-only address") -MSG(26, "Initialization failure") -MSG(27, "System alarm - shutting down") -MSG(28, "Failed to get planner buffer") -MSG(29, "Generic exception report") - -MSG(30, "Move time is infinite") -MSG(31, "Move time is NAN") -MSG(32, "Float is infinite") -MSG(33, "Float is NAN") -MSG(34, "Persistence error") -MSG(35, "Bad status report setting") -MSG(36, "36") -MSG(37, "37") -MSG(38, "38") -MSG(39, "39") - -MSG(40, "40") -MSG(41, "41") -MSG(42, "42") -MSG(43, "43") -MSG(44, "44") -MSG(45, "45") -MSG(46, "46") -MSG(47, "47") -MSG(48, "48") -MSG(49, "49") -MSG(50, "50") -MSG(51, "51") -MSG(52, "52") -MSG(53, "53") -MSG(54, "54") -MSG(55, "55") -MSG(56, "56") -MSG(57, "57") -MSG(58, "58") -MSG(59, "59") -MSG(60, "60") -MSG(61, "61") -MSG(62, "62") -MSG(63, "63") -MSG(64, "64") -MSG(65, "65") -MSG(66, "66") -MSG(67, "67") -MSG(68, "68") -MSG(69, "69") -MSG(70, "70") -MSG(71, "71") -MSG(72, "72") -MSG(73, "73") -MSG(74, "74") -MSG(75, "75") -MSG(76, "76") -MSG(77, "77") -MSG(78, "78") -MSG(79, "79") -MSG(80, "80") -MSG(81, "81") -MSG(82, "82") -MSG(83, "83") -MSG(84, "84") -MSG(85, "85") -MSG(86, "86") -MSG(87, "87") -MSG(88, "88") -MSG(89, "89") - -MSG(90, "Config sub-system assertion failure") -MSG(91, "IO sub-system assertion failure") -MSG(92, "Encoder assertion failure") -MSG(93, "Stepper assertion failure") -MSG(94, "Planner assertion failure") -MSG(95, "Canonical machine assertion failure") -MSG(96, "Controller assertion failure") -MSG(97, "Stack overflow detected") -MSG(98, "Memory fault detected") -MSG(99, "Generic assertion failure") - -MSG(100, "Unrecognized command or config name") -MSG(101, "Invalid or malformed command") -MSG(102, "Bad number format") -MSG(103, "Unsupported number or JSON type") -MSG(104, "Parameter is read-only") -MSG(105, "Parameter cannot be read") -MSG(106, "Command not accepted at this time") -MSG(107, "Input exceeds max length") -MSG(108, "Input less than minimum value") -MSG(109, "Input exceeds maximum value") - -MSG(110, "Input value range error") -MSG(111, "JSON syntax error") -MSG(112, "JSON input has too many pairs") -MSG(113, "JSON string too long") -MSG(114, "114") -MSG(115, "115") -MSG(116, "116") -MSG(117, "117") -MSG(118, "118") -MSG(119, "119") - -MSG(120, "120") -MSG(121, "121") -MSG(122, "122") -MSG(123, "123") -MSG(124, "124") -MSG(125, "125") -MSG(126, "126") -MSG(127, "127") -MSG(128, "128") -MSG(129, "129") - -MSG(130, "Generic Gcode input error") -MSG(131, "Gcode command unsupported") -MSG(132, "M code unsupported") -MSG(133, "Gcode modal group violation") -MSG(134, "Axis word missing") -MSG(135, "Axis cannot be present") -MSG(136, "Axis is invalid for this command") -MSG(137, "Axis is disabled") -MSG(138, "Axis target position is missing") -MSG(139, "Axis target position is invalid") - -MSG(140, "Selected plane is missing") -MSG(141, "Selected plane is invalid") -MSG(142, "Feedrate not specified") -MSG(143, "Inverse time mode cannot be used with this command") -MSG(144, "Rotary axes cannot be used with this command") -MSG(145, "G0 or G1 must be active for G53") -MSG(146, "Requested velocity exceeds limits") -MSG(147, "Cutter compensation cannot be enabled") -MSG(148, "Programmed point same as current point") -MSG(149, "Spindle speed below minimum") - -MSG(150, "Spindle speed exceeded maximum") -MSG(151, "Spindle S word is missing") -MSG(152, "Spindle S word is invalid") -MSG(153, "Spindle must be off for this command") -MSG(154, "Spindle must be turning for this command") -MSG(155, "Arc specification error") -MSG(156, "Arc specification error - missing axis(es)") -MSG(157, "Arc specification error - missing offset(s)") +MSG(01, "Eagain") +MSG(02, "Noop") +MSG(03, "Complete") +MSG(04, "No such device") +MSG(05, "Buffer full") +MSG(06, "Buffer full - fatal") +MSG(07, "EEPROM data invalid") +MSG(08, "Internal error") + +MSG(09, "Move time is infinite") +MSG(10, "Move time is NAN") + +MSG(11, "Unrecognized command or config name") +MSG(12, "Invalid or malformed command") +MSG(13, "Bad number format") +MSG(14, "Parameter is read-only") +MSG(15, "Parameter cannot be read") +MSG(16, "Command not accepted at this time") +MSG(17, "Input exceeds max length") +MSG(18, "Input less than minimum value") +MSG(19, "Input exceeds maximum value") +MSG(20, "Input value range error") + +MSG(21, "Gcode command unsupported") +MSG(22, "M code unsupported") +MSG(23, "Axis word missing") +MSG(24, "Feedrate not specified") +MSG(25, "Arc specification error") +MSG(26, "Arc specification error - missing axis") // current longest message: 56 char -MSG(158, "Arc specification error - radius arc out of tolerance") -MSG(159, "Arc specification error - endpoint is starting point") - -MSG(160, "P word is missing") -MSG(161, "P word is invalid") -MSG(162, "P word is zero") -MSG(163, "P word is negative") -MSG(164, "P word is not an integer") -MSG(165, "P word is not a valid tool number") -MSG(166, "D word is missing") -MSG(167, "D word is invalid") -MSG(168, "E word is missing") -MSG(169, "E word is invalid") - -MSG(170, "H word is missing") -MSG(171, "H word is invalid") -MSG(172, "L word is missing") -MSG(173, "L word is invalid") -MSG(174, "Q word is missing") -MSG(175, "Q word is invalid") -MSG(176, "R word is missing") -MSG(177, "R word is invalid") -MSG(178, "T word is missing") -MSG(179, "T word is invalid") - -MSG(180, "180") -MSG(181, "181") -MSG(182, "182") -MSG(183, "183") -MSG(184, "184") -MSG(185, "185") -MSG(186, "186") -MSG(187, "187") -MSG(188, "188") -MSG(189, "189") - -MSG(190, "190") -MSG(191, "191") -MSG(192, "192") -MSG(193, "193") -MSG(194, "194") -MSG(195, "195") -MSG(196, "196") -MSG(197, "197") -MSG(198, "198") -MSG(199, "199") - -MSG(200, "Generic firmware error") -MSG(201, "Move less than minimum length") -MSG(202, "Move less than minimum time") -MSG(203, "Machine is alarmed - Command not processed") -MSG(204, "Limit switch hit - Shutdown occurred") -MSG(205, "Trapezoid planner failed to converge") -MSG(206, "206") -MSG(207, "207") -MSG(208, "208") -MSG(209, "209") +MSG(27, "Arc specification error - radius arc out of tolerance") +MSG(28, "Arc specification error - endpoint is starting point") -MSG(210, "210") -MSG(211, "211") -MSG(212, "212") -MSG(213, "213") -MSG(214, "214") -MSG(215, "215") -MSG(216, "216") -MSG(217, "217") -MSG(218, "218") -MSG(219, "219") +MSG(29, "Move less than minimum length") +MSG(30, "Move less than minimum time") +MSG(31, "Machine is alarmed - Command not processed") +MSG(32, "Limit switch hit - Shutdown occurred") -MSG(220, "Soft limit exceeded") -MSG(221, "Soft limit exceeded - X min") -MSG(222, "Soft limit exceeded - X max") -MSG(223, "Soft limit exceeded - Y min") -MSG(224, "Soft limit exceeded - Y max") -MSG(225, "Soft limit exceeded - Z min") -MSG(226, "Soft limit exceeded - Z max") -MSG(227, "Soft limit exceeded - A min") -MSG(228, "Soft limit exceeded - A max") -MSG(229, "Soft limit exceeded - B min") -MSG(230, "Soft limit exceeded - B max") -MSG(231, "Soft limit exceeded - C min") -MSG(232, "Soft limit exceeded - C max") -MSG(233, "233") -MSG(234, "234") -MSG(235, "235") -MSG(236, "236") -MSG(237, "237") -MSG(238, "238") -MSG(239, "239") +MSG(33, "Soft limit exceeded") -MSG(240, "Homing cycle failed") -MSG(241, "Homing Error - Bad or no axis specified") -MSG(242, "Homing Error - Search velocity is zero") -MSG(243, "Homing Error - Latch velocity is zero") -MSG(244, "Homing Error - Travel min & max are the same") -MSG(245, "Homing Error - Negative latch backoff") -MSG(246, "Homing Error - Homing switches misconfigured") -MSG(247, "247") -MSG(248, "248") -MSG(249, "249") +MSG(34, "Homing cycle failed") +MSG(35, "Homing Error - Bad or no axis specified") +MSG(36, "Homing Error - Search velocity is zero") +MSG(37, "Homing Error - Latch velocity is zero") +MSG(38, "Homing Error - Travel min & max are the same") +MSG(39, "Homing Error - Negative latch backoff") +MSG(40, "Homing Error - Homing switches misconfigured") -MSG(250, "Probe cycle failed") -MSG(251, "Probe endpoint is starting point") -MSG(252, "Jogging cycle failed") +MSG(41, "Probe cycle failed") diff --git a/src/pwm.h b/src/pwm.h index 58b8612..3a10d20 100644 --- a/src/pwm.h +++ b/src/pwm.h @@ -31,6 +31,8 @@ #include "status.h" +#include + enum { PWM_1, diff --git a/src/status.c b/src/status.c index 769b2ec..2eb1039 100644 --- a/src/status.c +++ b/src/status.c @@ -3,8 +3,6 @@ This file is part of the Buildbotics firmware. Copyright (c) 2015 - 2016 Buildbotics LLC - Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - Copyright (c) 2013 - 2015 Robert Giseburt All rights reserved. This file ("the software") is free software: you can redistribute it diff --git a/src/status.h b/src/status.h index 2b2993e..b837e25 100644 --- a/src/status.h +++ b/src/status.h @@ -28,202 +28,69 @@ #pragma once -/* Status codes - * - * Status codes are divided into ranges for clarity and extensibility. At some - * point this may break down and the whole thing will get messy(er), but it's - * advised not to change the values of existing status codes once they are in - * distribution. - * - * Ranges are: - * - * 0 - 19 OS, communications and low-level status - * - * 20 - 99 Generic internal and application errors. Internal errors start at - * 20 and work up, Assertion failures start at 99 and work down. - * - * 100 - 129 Generic data and input errors - not specific to Gcode - * - * 130 - Gcode and application errors and warnings - * - * See main.c for associated message strings. Any changes to the codes may also - * require changing the message strings and string array in main.c - * - * Most of the status codes (except STAT_OK) below are errors which would fail - * the command, and are returned by the failed command and reported back via - * JSON or text. Some status codes are warnings do not fail the command. These - * can be used to generate an exception report. These are labeled as WARNING - */ - -#include - -typedef uint8_t stat_t; -extern stat_t status_code; - -void print_status_message(const char *msg, stat_t status); - // ritorno is a handy way to provide exception returns // It returns only if an error occurred. (ritorno is Italian for return) #define ritorno(a) if ((status_code = a) != STAT_OK) {return status_code;} +typedef enum { // OS, communications and low-level status -#define STAT_OK 0 // function completed OK -#define STAT_ERROR 1 // generic error return EPERM -#define STAT_EAGAIN 2 // function would block (call again) -#define STAT_NOOP 3 // function had no-operation -#define STAT_COMPLETE 4 // operation is complete -#define STAT_TERMINATE 5 // operation terminated (gracefully) -#define STAT_RESET 6 // operation was hard reset (sig kill) -#define STAT_EOL 7 // function returned end-of-line -#define STAT_EOF 8 // function returned end-of-file -#define STAT_FILE_NOT_OPEN 9 -#define STAT_FILE_SIZE_EXCEEDED 10 -#define STAT_NO_SUCH_DEVICE 11 -#define STAT_BUFFER_EMPTY 12 -#define STAT_BUFFER_FULL 13 -#define STAT_BUFFER_FULL_FATAL 14 -#define STAT_INITIALIZING 15 // initializing - not ready for use -#define STAT_ENTERING_BOOT_LOADER 16 // emitted from boot loader -#define STAT_FUNCTION_IS_STUBBED 17 -#define STAT_EEPROM_DATA_INVALID 18 - -// Internal errors and startup messages -#define STAT_INTERNAL_ERROR 20 // unrecoverable internal error -#define STAT_INTERNAL_RANGE_ERROR 21 // other than by user input -#define STAT_FLOATING_POINT_ERROR 22 // number conversion error -#define STAT_DIVIDE_BY_ZERO 23 -#define STAT_INVALID_ADDRESS 24 -#define STAT_READ_ONLY_ADDRESS 25 -#define STAT_INIT_FAIL 26 -#define STAT_ALARMED 27 -#define STAT_FAILED_TO_GET_PLANNER_BUFFER 28 -#define STAT_GENERIC_EXCEPTION_REPORT 29 // used for test - -#define STAT_PREP_LINE_MOVE_TIME_IS_INFINITE 30 -#define STAT_PREP_LINE_MOVE_TIME_IS_NAN 31 -#define STAT_FLOAT_IS_INFINITE 32 -#define STAT_FLOAT_IS_NAN 33 -#define STAT_PERSISTENCE_ERROR 34 -#define STAT_BAD_STATUS_REPORT_SETTING 35 - -// Assertion failures - down from 99 until they meet system internal errors -#define STAT_CONFIG_ASSERTION_FAILURE 90 -#define STAT_ENCODER_ASSERTION_FAILURE 92 -#define STAT_STEPPER_ASSERTION_FAILURE 93 -#define STAT_PLANNER_ASSERTION_FAILURE 94 -#define STAT_CANONICAL_MACHINE_ASSERTION_FAILURE 95 -#define STAT_CONTROLLER_ASSERTION_FAILURE 96 -#define STAT_STACK_OVERFLOW 97 -#define STAT_MEMORY_FAULT 98 -#define STAT_GENERIC_ASSERTION_FAILURE 99 - -// Application and data input errors + STAT_OK, // function completed OK + STAT_EAGAIN, // function would block (call again) + STAT_NOOP, // function had no-operation + STAT_COMPLETE, // operation is complete + STAT_NO_SUCH_DEVICE, + STAT_BUFFER_FULL, + STAT_BUFFER_FULL_FATAL, + STAT_EEPROM_DATA_INVALID, + STAT_INTERNAL_ERROR, // unrecoverable internal error + + STAT_PREP_LINE_MOVE_TIME_IS_INFINITE, + STAT_PREP_LINE_MOVE_TIME_IS_NAN, // Generic data input errors -#define STAT_UNRECOGNIZED_NAME 100 -#define STAT_INVALID_OR_MALFORMED_COMMAND 101 -#define STAT_BAD_NUMBER_FORMAT 102 -#define STAT_UNSUPPORTED_TYPE 103 -#define STAT_PARAMETER_IS_READ_ONLY 104 -#define STAT_PARAMETER_CANNOT_BE_READ 105 -#define STAT_COMMAND_NOT_ACCEPTED 106 -#define STAT_INPUT_EXCEEDS_MAX_LENGTH 107 -#define STAT_INPUT_LESS_THAN_MIN_VALUE 108 -#define STAT_INPUT_EXCEEDS_MAX_VALUE 109 - -#define STAT_INPUT_VALUE_RANGE_ERROR 110 -#define STAT_JSON_SYNTAX_ERROR 111 -#define STAT_JSON_TOO_MANY_PAIRS 112 -#define STAT_JSON_TOO_LONG 113 + STAT_UNRECOGNIZED_NAME, + STAT_INVALID_OR_MALFORMED_COMMAND, + STAT_BAD_NUMBER_FORMAT, + STAT_PARAMETER_IS_READ_ONLY, + STAT_PARAMETER_CANNOT_BE_READ, + STAT_COMMAND_NOT_ACCEPTED, + STAT_INPUT_EXCEEDS_MAX_LENGTH, + STAT_INPUT_LESS_THAN_MIN_VALUE, + STAT_INPUT_EXCEEDS_MAX_VALUE, + STAT_INPUT_VALUE_RANGE_ERROR, // Gcode errors and warnings (Most originate from NIST - by concept, not number) // Fascinating: http://www.cncalarms.com/ -#define STAT_GCODE_GENERIC_INPUT_ERROR 130 -#define STAT_GCODE_COMMAND_UNSUPPORTED 131 -#define STAT_MCODE_COMMAND_UNSUPPORTED 132 -#define STAT_GCODE_MODAL_GROUP_VIOLATION 133 -#define STAT_GCODE_AXIS_IS_MISSING 134 -#define STAT_GCODE_AXIS_CANNOT_BE_PRESENT 135 -#define STAT_GCODE_AXIS_IS_INVALID 136 -#define STAT_GCODE_AXIS_IS_NOT_CONFIGURED 137 -#define STAT_GCODE_AXIS_NUMBER_IS_MISSING 138 -#define STAT_GCODE_AXIS_NUMBER_IS_INVALID 139 - -#define STAT_GCODE_ACTIVE_PLANE_IS_MISSING 140 -#define STAT_GCODE_ACTIVE_PLANE_IS_INVALID 141 -#define STAT_GCODE_FEEDRATE_NOT_SPECIFIED 142 -#define STAT_GCODE_INVERSE_TIME_MODE_CANNOT_BE_USED 143 -#define STAT_GCODE_ROTARY_AXIS_CANNOT_BE_USED 144 -#define STAT_GCODE_G53_WITHOUT_G0_OR_G1 145 -#define STAT_REQUESTED_VELOCITY_EXCEEDS_LIMITS 146 -#define STAT_CUTTER_COMPENSATION_CANNOT_BE_ENABLED 147 -#define STAT_PROGRAMMED_POINT_SAME_AS_CURRENT_POINT 148 -#define STAT_SPINDLE_SPEED_BELOW_MINIMUM 149 - -#define STAT_SPINDLE_SPEED_MAX_EXCEEDED 150 -#define STAT_S_WORD_IS_MISSING 151 -#define STAT_S_WORD_IS_INVALID 152 -#define STAT_SPINDLE_MUST_BE_OFF 153 -#define STAT_SPINDLE_MUST_BE_TURNING 154 -#define STAT_ARC_SPECIFICATION_ERROR 155 -#define STAT_ARC_AXIS_MISSING_FOR_SELECTED_PLANE 156 -#define STAT_ARC_OFFSETS_MISSING_FOR_SELECTED_PLANE 157 -#define STAT_ARC_RADIUS_OUT_OF_TOLERANCE 158 -#define STAT_ARC_ENDPOINT_IS_STARTING_POINT 159 - -#define STAT_P_WORD_IS_MISSING 160 -#define STAT_P_WORD_IS_INVALID 161 -#define STAT_P_WORD_IS_ZERO 162 -#define STAT_P_WORD_IS_NEGATIVE 163 -#define STAT_P_WORD_IS_NOT_AN_INTEGER 164 -#define STAT_P_WORD_IS_NOT_VALID_TOOL_NUMBER 165 -#define STAT_D_WORD_IS_MISSING 166 -#define STAT_D_WORD_IS_INVALID 167 -#define STAT_E_WORD_IS_MISSING 168 -#define STAT_E_WORD_IS_INVALID 169 - -#define STAT_H_WORD_IS_MISSING 170 -#define STAT_H_WORD_IS_INVALID 171 -#define STAT_L_WORD_IS_MISSING 172 -#define STAT_L_WORD_IS_INVALID 173 -#define STAT_Q_WORD_IS_MISSING 174 -#define STAT_Q_WORD_IS_INVALID 175 -#define STAT_R_WORD_IS_MISSING 176 -#define STAT_R_WORD_IS_INVALID 177 -#define STAT_T_WORD_IS_MISSING 178 -#define STAT_T_WORD_IS_INVALID 179 + STAT_GCODE_COMMAND_UNSUPPORTED, + STAT_MCODE_COMMAND_UNSUPPORTED, + STAT_GCODE_AXIS_IS_MISSING, + STAT_GCODE_FEEDRATE_NOT_SPECIFIED, + STAT_ARC_SPECIFICATION_ERROR, + STAT_ARC_AXIS_MISSING_FOR_SELECTED_PLANE, + STAT_ARC_RADIUS_OUT_OF_TOLERANCE, + STAT_ARC_ENDPOINT_IS_STARTING_POINT, // Errors and warnings -#define STAT_GENERIC_ERROR 200 -#define STAT_MINIMUM_LENGTH_MOVE 201 // move is less than minimum length -#define STAT_MINIMUM_TIME_MOVE 202 // move is less than minimum time -#define STAT_MACHINE_ALARMED 203 // machine is alarmed -#define STAT_LIMIT_SWITCH_HIT 204 // a limit switch was hit -#define STAT_PLANNER_FAILED_TO_CONVERGE 205 // trapezoid generator throws this - -#define STAT_SOFT_LIMIT_EXCEEDED 220 // axis unspecified -#define STAT_SOFT_LIMIT_EXCEEDED_XMIN 221 -#define STAT_SOFT_LIMIT_EXCEEDED_XMAX 222 -#define STAT_SOFT_LIMIT_EXCEEDED_YMIN 223 -#define STAT_SOFT_LIMIT_EXCEEDED_YMAX 224 -#define STAT_SOFT_LIMIT_EXCEEDED_ZMIN 225 -#define STAT_SOFT_LIMIT_EXCEEDED_ZMAX 226 -#define STAT_SOFT_LIMIT_EXCEEDED_AMIN 227 -#define STAT_SOFT_LIMIT_EXCEEDED_AMAX 228 -#define STAT_SOFT_LIMIT_EXCEEDED_BMIN 229 -#define STAT_SOFT_LIMIT_EXCEEDED_BMAX 220 -#define STAT_SOFT_LIMIT_EXCEEDED_CMIN 231 -#define STAT_SOFT_LIMIT_EXCEEDED_CMAX 232 - -#define STAT_HOMING_CYCLE_FAILED 240 // homing cycle did not complete -#define STAT_HOMING_ERROR_BAD_OR_NO_AXIS 241 -#define STAT_HOMING_ERROR_ZERO_SEARCH_VELOCITY 242 -#define STAT_HOMING_ERROR_ZERO_LATCH_VELOCITY 243 -#define STAT_HOMING_ERROR_TRAVEL_MIN_MAX_IDENTICAL 244 -#define STAT_HOMING_ERROR_NEGATIVE_LATCH_BACKOFF 245 -#define STAT_HOMING_ERROR_SWITCH_MISCONFIGURATION 246 - -#define STAT_PROBE_CYCLE_FAILED 250 // probing cycle did not complete -#define STAT_PROBE_ENDPOINT_IS_STARTING_POINT 251 - -// Do not exceed 255 without also changing stat_t typedef + STAT_MINIMUM_LENGTH_MOVE, // move is less than minimum length + STAT_MINIMUM_TIME_MOVE, // move is less than minimum time + STAT_MACHINE_ALARMED, // machine is alarmed + STAT_LIMIT_SWITCH_HIT, // a limit switch was hit + + STAT_SOFT_LIMIT_EXCEEDED, + + STAT_HOMING_CYCLE_FAILED, // homing cycle did not complete + STAT_HOMING_ERROR_BAD_OR_NO_AXIS, + STAT_HOMING_ERROR_ZERO_SEARCH_VELOCITY, + STAT_HOMING_ERROR_ZERO_LATCH_VELOCITY, + STAT_HOMING_ERROR_TRAVEL_MIN_MAX_IDENTICAL, + STAT_HOMING_ERROR_NEGATIVE_LATCH_BACKOFF, + STAT_HOMING_ERROR_SWITCH_MISCONFIGURATION, + + STAT_PROBE_CYCLE_FAILED, // probing cycle did not complete + // Do not exceed 255 +} stat_t; + + +extern stat_t status_code; + +void print_status_message(const char *msg, stat_t status);