Simplify G-code debug option

This commit is contained in:
Scott Lahteine 2018-01-23 23:42:28 -06:00
parent 608f8b10da
commit 053b1371c7
2 changed files with 3 additions and 13 deletions

View File

@ -225,13 +225,7 @@ void GCodeParser::parse(char *p) {
#endif
#if ENABLED(FASTER_GCODE_PARSER)
{
set(code, has_num ? p : NULL // Set parameter exists and pointer (NULL for no number)
#if ENABLED(DEBUG_GCODE_PARSER)
, debug
#endif
);
}
set(code, has_num ? p : NULL); // Set parameter exists and pointer (NULL for no number)
#endif
}
else if (!string_arg) { // Not A-Z? First time, keep as the string_arg

View File

@ -98,17 +98,13 @@ public:
#if ENABLED(FASTER_GCODE_PARSER)
// Set the flag and pointer for a parameter
static void set(const char c, char * const ptr
#if ENABLED(DEBUG_GCODE_PARSER)
, const bool debug=false
#endif
) {
static void set(const char c, char * const ptr) {
const uint8_t ind = LETTER_OFF(c);
if (ind >= COUNT(param)) return; // Only A-Z
SBI(codebits[PARAM_IND(ind)], PARAM_BIT(ind)); // parameter exists
param[ind] = ptr ? ptr - command_ptr : 0; // parameter offset or 0
#if ENABLED(DEBUG_GCODE_PARSER)
if (debug) {
if (codenum == 800) {
SERIAL_ECHOPAIR("Set bit ", (int)PARAM_BIT(ind));
SERIAL_ECHOPAIR(" of index ", (int)PARAM_IND(ind));
SERIAL_ECHOLNPAIR(" | param = ", (int)param[ind]);