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