Skip to content

Commit

Permalink
V0.7 Fixes: 2 Closes #2 Fixes problem with parsing after ; comment
Browse files Browse the repository at this point in the history
  • Loading branch information
arhi committed Feb 21, 2018
1 parent 37d18ea commit 46331a1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion calcmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,37 @@ double calcmove(char * buffer, print_settings_t * print_settings){
e = olde;

while('\0' != (c = *(buff++)) ){
bool endofline;
endofline = false;
if ((c & 0xDF) == 'G'){
while('\0' != (c = *(buff++)) ){
switch (c & 0xDF){
switch (c){
case 'X':
case 'x':
x = atof(buff++);
break;
case 'Y':
case 'y':
y = atof(buff++);
break;
case 'Z':
case 'z':
z = atof(buff++);
break;
case 'E':
case 'e':
e = atof(buff++);
break;
case 'F':
case 'f':
f = atof(buff++)/60.0; //convert speed to units/second from units/minute
break;
case ';':
case '\n':
case '\r':
endofline = true;
}
if (endofline) break;
}
break;
}
Expand Down
4 changes: 2 additions & 2 deletions gcodestat.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* File gcodestat.c v0.6
* File gcodestat.c v0.7
* Author: arhimed@gmail.com
* Date 20070721
*
Expand Down Expand Up @@ -66,7 +66,7 @@ void print_usage() {
* print_config(*print_settings) - print config info
*/
void print_config(print_settings_t * ps) {
fprintf(stderr, "gcodestat v0.6\n");
fprintf(stderr, "gcodestat v0.7\n");
fprintf(stderr, "Starting with parameters:\n");
fprintf(stderr, "\tacceleration: \t\t%f mm/sec/sec\n", ps->accel);
fprintf(stderr, "\tjunction deviation: \t%f\n", ps->jdev);
Expand Down

0 comments on commit 46331a1

Please sign in to comment.