From 1161056bf25ff13a9031746127233d911aef54ea Mon Sep 17 00:00:00 2001 From: Sonny Jeon Date: Fri, 4 Nov 2016 10:50:28 -0600 Subject: [PATCH] Fixed a g-code parser issue caused by last commit. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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. --- doc/log/commit_log_v1.1.txt | 37 +++++++++++++++++++++++++++++++++++++ grbl/gcode.c | 5 +++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/doc/log/commit_log_v1.1.txt b/doc/log/commit_log_v1.1.txt index 32b63f7..e83b264 100644 --- a/doc/log/commit_log_v1.1.txt +++ b/doc/log/commit_log_v1.1.txt @@ -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 shouldn’t 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, I’m +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. It’s 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 Author: Sonny Jeon diff --git a/grbl/gcode.c b/grbl/gcode.c index e1fcfa2..69ea0af 100644 --- a/grbl/gcode.c +++ b/grbl/gcode.c @@ -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: