|
@ -51,13 +51,13 @@ char *GCodeParser::command_ptr, |
|
|
char GCodeParser::command_letter; |
|
|
char GCodeParser::command_letter; |
|
|
int GCodeParser::codenum; |
|
|
int GCodeParser::codenum; |
|
|
|
|
|
|
|
|
#if USE_GCODE_SUBCODES |
|
|
#if ENABLED(USE_GCODE_SUBCODES) |
|
|
uint8_t GCodeParser::subcode; |
|
|
uint8_t GCodeParser::subcode; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#if ENABLED(GCODE_MOTION_MODES) |
|
|
#if ENABLED(GCODE_MOTION_MODES) |
|
|
int16_t GCodeParser::motion_mode_codenum = -1; |
|
|
int16_t GCodeParser::motion_mode_codenum = -1; |
|
|
#if USE_GCODE_SUBCODES |
|
|
#if ENABLED(USE_GCODE_SUBCODES) |
|
|
uint8_t GCodeParser::motion_mode_subcode; |
|
|
uint8_t GCodeParser::motion_mode_subcode; |
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
@ -83,7 +83,7 @@ void GCodeParser::reset() { |
|
|
string_arg = nullptr; // No whole line argument
|
|
|
string_arg = nullptr; // No whole line argument
|
|
|
command_letter = '?'; // No command letter
|
|
|
command_letter = '?'; // No command letter
|
|
|
codenum = 0; // No command code
|
|
|
codenum = 0; // No command code
|
|
|
#if USE_GCODE_SUBCODES |
|
|
#if ENABLED(USE_GCODE_SUBCODES) |
|
|
subcode = 0; // No command sub-code
|
|
|
subcode = 0; // No command sub-code
|
|
|
#endif |
|
|
#endif |
|
|
#if ENABLED(FASTER_GCODE_PARSER) |
|
|
#if ENABLED(FASTER_GCODE_PARSER) |
|
@ -187,7 +187,7 @@ void GCodeParser::parse(char *p) { |
|
|
do { codenum *= 10, codenum += *p++ - '0'; } while (NUMERIC(*p)); |
|
|
do { codenum *= 10, codenum += *p++ - '0'; } while (NUMERIC(*p)); |
|
|
|
|
|
|
|
|
// Allow for decimal point in command
|
|
|
// Allow for decimal point in command
|
|
|
#if USE_GCODE_SUBCODES |
|
|
#if ENABLED(USE_GCODE_SUBCODES) |
|
|
if (*p == '.') { |
|
|
if (*p == '.') { |
|
|
p++; |
|
|
p++; |
|
|
while (NUMERIC(*p)) |
|
|
while (NUMERIC(*p)) |
|
@ -206,7 +206,7 @@ void GCodeParser::parse(char *p) { |
|
|
) |
|
|
) |
|
|
) { |
|
|
) { |
|
|
motion_mode_codenum = codenum; |
|
|
motion_mode_codenum = codenum; |
|
|
#if USE_GCODE_SUBCODES |
|
|
#if ENABLED(USE_GCODE_SUBCODES) |
|
|
motion_mode_subcode = subcode; |
|
|
motion_mode_subcode = subcode; |
|
|
#endif |
|
|
#endif |
|
|
} |
|
|
} |
|
@ -225,7 +225,7 @@ void GCodeParser::parse(char *p) { |
|
|
if (motion_mode_codenum < 0) return; |
|
|
if (motion_mode_codenum < 0) return; |
|
|
command_letter = 'G'; |
|
|
command_letter = 'G'; |
|
|
codenum = motion_mode_codenum; |
|
|
codenum = motion_mode_codenum; |
|
|
#if USE_GCODE_SUBCODES |
|
|
#if ENABLED(USE_GCODE_SUBCODES) |
|
|
subcode = motion_mode_subcode; |
|
|
subcode = motion_mode_subcode; |
|
|
#endif |
|
|
#endif |
|
|
p--; // Back up one character to use the current parameter
|
|
|
p--; // Back up one character to use the current parameter
|
|
|