From bfbf5f820063a4cb64533036d1bca61873187c35 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Wed, 28 Jun 2017 19:42:54 -0500 Subject: [PATCH] correct value_bool() when FASTER_GCODE_PARSER is enabled Also corrected compile issue when DEBUG_GCODE_PARSER and AUTO_BED_LEVELING_UBL are both enabled. --- Marlin/gcode.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Marlin/gcode.h b/Marlin/gcode.h index 42a5c89b14..b819fd075d 100644 --- a/Marlin/gcode.h +++ b/Marlin/gcode.h @@ -36,7 +36,11 @@ //#define DEBUG_GCODE_PARSER #if ENABLED(DEBUG_GCODE_PARSER) - #include "hex_print_routines.h" + #if ENABLED(AUTO_BED_LEVELING_UBL) + extern char* hex_address(const void * const w); + #else + #include "hex_print_routines.h" + #endif #include "serial.h" #endif @@ -132,7 +136,7 @@ public: const uint8_t ind = LETTER_OFF(c); if (ind >= COUNT(param)) return false; // Only A-Z const bool b = TEST(codebits[PARAM_IND(ind)], PARAM_BIT(ind)); - if (b) value_ptr = command_ptr + param[ind]; + if (b) value_ptr = param[ind] ? command_ptr + param[ind] : (char*)NULL; return b; }