Add parser.is_command(letter, code)

This commit is contained in:
Scott Lahteine
2020-11-14 18:09:17 -06:00
parent 189306d24e
commit c5e411f492
4 changed files with 15 additions and 9 deletions

View File

@@ -84,7 +84,7 @@ public:
static char *command_ptr, // The command, so it can be echoed
*string_arg, // string of command line
command_letter; // G, M, or T
static int codenum; // 123
static uint16_t codenum; // 123
#if ENABLED(USE_GCODE_SUBCODES)
static uint8_t subcode; // .1
#endif
@@ -244,6 +244,9 @@ public:
static bool chain();
#endif
// Test whether the parsed command matches the input
static inline bool is_command(const char ltr, const uint16_t num) { return command_letter == ltr && codenum == num; }
// The code value pointer was set
FORCE_INLINE static bool has_value() { return !!value_ptr; }