blob: f67b9dea6c55b8759f7245216677dc3bf9777680 (
plain)
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
|
/*
* GCodeResult.h
*
* Created on: 1 Oct 2017
* Author: David
*/
#ifndef SRC_GCODES_GCODERESULT_H_
#define SRC_GCODES_GCODERESULT_H_
#include <cctype>
// Enumeration to specify the result of attempting to process a GCode command
enum class GCodeResult : uint8_t
{
notFinished, // we haven't finished processing this command
ok, // we have finished processing this code
error,
warning,
warningNotSupported,
errorNotSupported,
notSupportedInCurrentMode,
badOrMissingParameter,
remoteInternalError
};
// Convert a true/false error/no-error indication to a GCodeResult
inline GCodeResult GetGCodeResultFromError(bool err) noexcept
{
return (err) ? GCodeResult::error : GCodeResult::ok;
}
// Convert a true/false finished/not-finished indication to a GCodeResult
inline GCodeResult GetGCodeResultFromFinished(bool finished) noexcept
{
return (finished) ? GCodeResult::ok : GCodeResult::notFinished;
}
#endif /* SRC_GCODES_GCODERESULT_H_ */
|