forked from grblHAL/core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
errors.h
137 lines (117 loc) · 4.19 KB
/
errors.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
errors.h -
Part of grblHAL
Copyright (c) 2017-2023 Terje Io
Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Grbl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Grbl is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _ERRORS_H_
#define _ERRORS_H_
#include <stddef.h>
// Define Grbl status codes. Valid values (0-255)
typedef enum {
Status_OK = 0,
Status_ExpectedCommandLetter = 1,
Status_BadNumberFormat = 2,
Status_InvalidStatement = 3,
Status_NegativeValue = 4,
Status_HomingDisabled = 5,
Status_SettingStepPulseMin = 6,
Status_SettingReadFail = 7,
Status_IdleError = 8,
Status_SystemGClock = 9,
Status_SoftLimitError = 10,
Status_Overflow = 11,
Status_MaxStepRateExceeded = 12,
Status_CheckDoor = 13,
Status_LineLengthExceeded = 14,
Status_TravelExceeded = 15,
Status_InvalidJogCommand = 16,
Status_SettingDisabledLaser = 17,
Status_Reset = 18,
Status_NonPositiveValue = 19,
Status_GcodeUnsupportedCommand = 20,
Status_GcodeModalGroupViolation = 21,
Status_GcodeUndefinedFeedRate = 22,
Status_GcodeCommandValueNotInteger = 23,
Status_GcodeAxisCommandConflict = 24,
Status_GcodeWordRepeated = 25,
Status_GcodeNoAxisWords = 26,
Status_GcodeInvalidLineNumber = 27,
Status_GcodeValueWordMissing = 28,
Status_GcodeUnsupportedCoordSys = 29,
Status_GcodeG53InvalidMotionMode = 30,
Status_GcodeAxisWordsExist = 31,
Status_GcodeNoAxisWordsInPlane = 32,
Status_GcodeInvalidTarget = 33,
Status_GcodeArcRadiusError = 34,
Status_GcodeNoOffsetsInPlane = 35,
Status_GcodeUnusedWords = 36,
Status_GcodeG43DynamicAxisError = 37,
Status_GcodeIllegalToolTableEntry = 38,
Status_GcodeValueOutOfRange = 39,
Status_GcodeToolChangePending = 40,
Status_GcodeSpindleNotRunning = 41,
Status_GcodeIllegalPlane = 42,
Status_GcodeMaxFeedRateExceeded = 43,
Status_GcodeRPMOutOfRange = 44,
Status_LimitsEngaged = 45,
Status_HomingRequired = 46,
Status_GCodeToolError = 47,
Status_ValueWordConflict = 48,
Status_SelfTestFailed = 49,
Status_EStop = 50,
Status_MotorFault = 51,
Status_SettingValueOutOfRange = 52,
Status_SettingDisabled = 53,
Status_GcodeInvalidRetractPosition = 54,
Status_IllegalHomingConfiguration = 55,
Status_GCodeCoordSystemLocked = 56,
// Some error codes as defined in bdring's ESP32 port
Status_SDMountError = 60,
Status_SDReadError = 61,
Status_SDFailedOpenDir = 62,
Status_SDDirNotFound = 63,
Status_SDFileEmpty = 64,
Status_BTInitError = 70,
//
Status_ExpressionUknownOp = 71,
Status_ExpressionDivideByZero = 72,
Status_ExpressionArgumentOutOfRange = 73,
Status_ExpressionInvalidArgument = 74,
Status_ExpressionSyntaxError = 75,
Status_ExpressionInvalidResult = 76,
Status_AuthenticationRequired = 77,
Status_AccessDenied = 78,
Status_NotAllowedCriticalEvent = 79,
Status_FlowControlNotExecutingMacro = 80,
Status_FlowControlSyntaxError = 81,
Status_FlowControlStackOverflow = 82,
Status_FlowControlOutOfMemory = 83,
Status_Unhandled, // For internal use only
Status_StatusMax = Status_Unhandled
} __attribute__ ((__packed__)) status_code_t;
typedef struct {
status_code_t id;
const char *description;
} status_detail_t;
typedef struct error_details {
const uint16_t n_errors;
const status_detail_t *errors;
struct error_details *next;
} error_details_t;
typedef error_details_t *(*on_get_errors_ptr)(void);
error_details_t *errors_get_details (void);
const char *errors_get_description (status_code_t id);
void errors_register (error_details_t *details);
#endif