Fixed a g-code parser issue caused by last commit.
- G-code parser refactoring in the last commit wasn’t tested. Found and fixed issues with G28.1/30.1 and G38.x probe commands. They were not being accepted due to a borked mantissa check.
This commit is contained in:
@ -151,7 +151,7 @@ uint8_t gc_execute_line(char *line)
|
||||
word_bit = MODAL_GROUP_G0;
|
||||
gc_block.non_modal_command = int_value;
|
||||
if ((int_value == 28) || (int_value == 30) || (int_value == 92)) {
|
||||
if ((mantissa != 0) || (mantissa != 10)) { FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); }
|
||||
if (!((mantissa == 0) || (mantissa == 10))) { FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); }
|
||||
gc_block.non_modal_command += mantissa;
|
||||
mantissa = 0; // Set to zero to indicate valid non-integer G command.
|
||||
}
|
||||
@ -166,10 +166,11 @@ uint8_t gc_execute_line(char *line)
|
||||
word_bit = MODAL_GROUP_G1;
|
||||
gc_block.modal.motion = int_value;
|
||||
if (int_value == 38){
|
||||
if ((mantissa != 20) || (mantissa != 30) || (mantissa != 40) || (mantissa != 50)) {
|
||||
if (!((mantissa == 20) || (mantissa == 30) || (mantissa == 40) || (mantissa == 50))) {
|
||||
FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); // [Unsupported G38.x command]
|
||||
}
|
||||
gc_block.modal.motion += (mantissa/10)+100;
|
||||
mantissa = 0; // Set to zero to indicate valid non-integer G command.
|
||||
}
|
||||
break;
|
||||
case 17: case 18: case 19:
|
||||
|
Reference in New Issue
Block a user