blob: 563029d7895fb57e91e4985a879238388881b696 (
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
|
/*
* 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,
ok,
error,
warning,
notSupported,
notSupportedInCurrentMode,
badOrMissingParameter
};
// Convert a true/false error/no-error indication to a GCodeResult
inline GCodeResult GetGCodeResultFromError(bool err)
{
return (err) ? GCodeResult::error : GCodeResult::ok;
}
// Convert a true/false finished/not-finished indication to a GCodeResult
inline GCodeResult GetGCodeResultFromFinished(bool finished)
{
return (finished) ? GCodeResult::ok : GCodeResult::notFinished;
}
#endif /* SRC_GCODES_GCODERESULT_H_ */
|