forked from grblHAL/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
messages.c
62 lines (52 loc) · 2.64 KB
/
messages.c
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
/*
messages.c - system messages
Part of grblHAL
Copyright (c) 2017-2023 Terje Io
Copyright (c) 2014-2016 Sungeun K. Jeon for Gnea Research LLC
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/>.
*/
#include "grbl.h"
#include "messages.h"
PROGMEM static const message_t messages[] = {
{ .id = Message_None, .text = "" },
{ .id = Message_CriticalEvent, .text = "Reset to continue" },
{ .id = Message_AlarmLock, .text = "'$H'|'$X' to unlock" },
{ .id = Message_AlarmUnlock, .text = "Caution: Unlocked" },
{ .id = Message_Enabled, .text = "Enabled" },
{ .id = Message_Disabled, .text = "Disabled" },
{ .id = Message_SafetyDoorAjar, .text = "Check Door" },
{ .id = Message_CheckLimits, .text = "Check Limits" },
{ .id = Message_ProgramEnd, .text = "Pgm End" },
{ .id = Message_RestoreDefaults, .text = "Restoring defaults" },
{ .id = Message_SpindleRestore, .text = "Restoring spindle" },
{ .id = Message_SleepMode, .text = "Sleeping" },
{ .id = Message_EStop, .text = "Emergency stop - clear, then reset to continue" },
{ .id = Message_HomingCycleRequired, .text = "Homing cycle required" },
{ .id = Message_CycleStartToRerun, .text = "Press cycle start to rerun job" },
{ .id = Message_ReferenceTLOEstablished, .text = "Reference tool length offset established" },
{ .id = Message_MotorFault, .text = "Motor fault - clear, then reset to continue" },
{ .id = Message_CycleStart2Continue, .text = "Press cycle start to continue." },
{ .id = Message_TPCycleStart2Continue, .text = "Remove any touch plate and press cycle start to continue." },
{ .id = Message_ProbeFailedRetry, .text = "Probe failed, try again." },
{ .id = Message_ExecuteTPW, .text = "Perform a probe with $TPW first!", .type = Message_Warning},
{ .id = Message_ProbeProtected, .text = "Probe protection activated."}
};
const message_t *message_get (message_code_t id)
{
uint_fast16_t idx = 0;
const message_t *msg = NULL;
do {
if(messages[idx].id == id)
msg = &messages[idx];
} while(msg == NULL && ++idx < Message_NextMessage);
return msg;
}