From 8b0556bcfdba918329d6a37a6ce057f1d31a4f86 Mon Sep 17 00:00:00 2001 From: Sonny J Date: Mon, 15 Aug 2011 19:14:25 -0600 Subject: [PATCH] Revert fdc90f1821f1f5edb7756fcddce75b4b4fbf6bbf^..HEAD --- gcode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcode.c b/gcode.c index 62fec77..be62ce8 100644 --- a/gcode.c +++ b/gcode.c @@ -117,8 +117,7 @@ static double theta(double x, double y) #endif // Executes one line of 0-terminated G-Code. The line is assumed to contain only uppercase -// characters and signed floating point values (no whitespace). Comments and block delete -// characters have been removed. +// characters and signed floating point values (no whitespace). uint8_t gc_execute_line(char *line) { uint8_t char_counter = 0; char letter; @@ -140,6 +139,10 @@ uint8_t gc_execute_line(char *line) { gc.status_code = STATUS_OK; + // Disregard comments and block delete + if (line[0] == '(') { return(gc.status_code); } + if (line[0] == '/') { char_counter++; } // ignore block delete + // Pass 1: Commands while(next_statement(&letter, &value, line, &char_counter)) { int_value = trunc(value);