Skip to content

Commit 1161056

Browse files
committed
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.
1 parent 6e3fb6b commit 1161056

2 files changed

Lines changed: 40 additions & 2 deletions

File tree

doc/log/commit_log_v1.1.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
----------------
2+
Date: 2016-11-04
3+
Author: Sonny Jeon
4+
Subject: Improved constant laser power per rate mode. Re-factored for flash size. Minor bug fixes.
5+
6+
- NOTE: This commit has largely been untested.
7+
8+
- Constant laser power per rate mode has been improved. Altered its
9+
implementation to be more responsive and accurate.
10+
11+
- Based on LaserWeb dev feedback, only G1, G2, and G3 moves operate
12+
with constant laser power mode. Meaning that G0, G38.x, and $J jogging
13+
motions operate without it and will keep a constant power output. This
14+
was specifically requested as a way to focus the laser by keeping the
15+
laser on when not moving. Operationally, this shouldn’t alter how the
16+
laser mode operates.
17+
18+
- Re-factored parts of the g-code parser and g-code state reports to
19+
save a few hundred bytes of flash. What was done makes the code a bit
20+
more unreadable (bad), but the flash space was in dire need. So, I’m
21+
willing to live with it for now.
22+
23+
- Fixed a problem with $G g-code state reports. Showed `M0` program
24+
pause during a run state. Now fixed to show nothing during a run state.
25+
Also, `M30` program end was shown as `M2`. This was also corrected.
26+
27+
- Improved spindle stop override responsiveness by removing the
28+
enforced spindle restoring delay. It’s not needed for a feature that is
29+
user controlled.
30+
31+
- Fixed a bug with G2/3 arcs in inverse time mode.
32+
33+
- Updated the interface.md document to make it more clear how WPos: or
34+
MPos: can be calculated from WCO:. Some GUI devs have failed to catch
35+
this in the documentation.
36+
37+
138
----------------
239
Date: 2016-10-27
340
Author: Sonny Jeon

grbl/gcode.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ uint8_t gc_execute_line(char *line)
151151
word_bit = MODAL_GROUP_G0;
152152
gc_block.non_modal_command = int_value;
153153
if ((int_value == 28) || (int_value == 30) || (int_value == 92)) {
154-
if ((mantissa != 0) || (mantissa != 10)) { FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); }
154+
if (!((mantissa == 0) || (mantissa == 10))) { FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); }
155155
gc_block.non_modal_command += mantissa;
156156
mantissa = 0; // Set to zero to indicate valid non-integer G command.
157157
}
@@ -166,10 +166,11 @@ uint8_t gc_execute_line(char *line)
166166
word_bit = MODAL_GROUP_G1;
167167
gc_block.modal.motion = int_value;
168168
if (int_value == 38){
169-
if ((mantissa != 20) || (mantissa != 30) || (mantissa != 40) || (mantissa != 50)) {
169+
if (!((mantissa == 20) || (mantissa == 30) || (mantissa == 40) || (mantissa == 50))) {
170170
FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); // [Unsupported G38.x command]
171171
}
172172
gc_block.modal.motion += (mantissa/10)+100;
173+
mantissa = 0; // Set to zero to indicate valid non-integer G command.
173174
}
174175
break;
175176
case 17: case 18: case 19:

0 commit comments

Comments
 (0)