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:
Sonny Jeon 2016-11-04 10:50:28 -06:00
parent 6e3fb6bd13
commit 1161056bf2
2 changed files with 40 additions and 2 deletions

View File

@ -1,3 +1,40 @@
----------------
Date: 2016-11-04
Author: Sonny Jeon
Subject: Improved constant laser power per rate mode. Re-factored for flash size. Minor bug fixes.
- NOTE: This commit has largely been untested.
- Constant laser power per rate mode has been improved. Altered its
implementation to be more responsive and accurate.
- Based on LaserWeb dev feedback, only G1, G2, and G3 moves operate
with constant laser power mode. Meaning that G0, G38.x, and $J jogging
motions operate without it and will keep a constant power output. This
was specifically requested as a way to focus the laser by keeping the
laser on when not moving. Operationally, this shouldnt alter how the
laser mode operates.
- Re-factored parts of the g-code parser and g-code state reports to
save a few hundred bytes of flash. What was done makes the code a bit
more unreadable (bad), but the flash space was in dire need. So, Im
willing to live with it for now.
- Fixed a problem with $G g-code state reports. Showed `M0` program
pause during a run state. Now fixed to show nothing during a run state.
Also, `M30` program end was shown as `M2`. This was also corrected.
- Improved spindle stop override responsiveness by removing the
enforced spindle restoring delay. Its not needed for a feature that is
user controlled.
- Fixed a bug with G2/3 arcs in inverse time mode.
- Updated the interface.md document to make it more clear how WPos: or
MPos: can be calculated from WCO:. Some GUI devs have failed to catch
this in the documentation.
---------------- ----------------
Date: 2016-10-27 Date: 2016-10-27
Author: Sonny Jeon Author: Sonny Jeon

View File

@ -151,7 +151,7 @@ uint8_t gc_execute_line(char *line)
word_bit = MODAL_GROUP_G0; word_bit = MODAL_GROUP_G0;
gc_block.non_modal_command = int_value; gc_block.non_modal_command = int_value;
if ((int_value == 28) || (int_value == 30) || (int_value == 92)) { 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; gc_block.non_modal_command += mantissa;
mantissa = 0; // Set to zero to indicate valid non-integer G command. 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; word_bit = MODAL_GROUP_G1;
gc_block.modal.motion = int_value; gc_block.modal.motion = int_value;
if (int_value == 38){ 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] FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); // [Unsupported G38.x command]
} }
gc_block.modal.motion += (mantissa/10)+100; gc_block.modal.motion += (mantissa/10)+100;
mantissa = 0; // Set to zero to indicate valid non-integer G command.
} }
break; break;
case 17: case 18: case 19: case 17: case 18: case 19: