Skip to content

Commit c46c4c5

Browse files
authored
Merge pull request #264 from synthetos/dev-263-G10-commands-issue
Fixed issue #263 - G10 L20 commands not working
2 parents fd4f1d7 + 9fe3aac commit c46c4c5

File tree

6 files changed

+37
-37
lines changed

6 files changed

+37
-37
lines changed

g2core/g2core.cppproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<InterfaceName>SWD</InterfaceName>
7474
</ToolOptions>
7575
<ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
76-
<ToolNumber>J41800036434</ToolNumber>
76+
<ToolNumber>J41800030015</ToolNumber>
7777
<ToolName>Atmel-ICE</ToolName>
7878
</com_atmel_avrdbg_tool_atmelice>
7979
<UseGdb>True</UseGdb>
@@ -100,7 +100,7 @@
100100
<HWProgramCounterSampling>True</HWProgramCounterSampling>
101101
</PercepioTrace>
102102
<preserveEEPROM>true</preserveEEPROM>
103-
<avrtoolserialnumber>J41800036434</avrtoolserialnumber>
103+
<avrtoolserialnumber>J41800030015</avrtoolserialnumber>
104104
<avrdeviceexpectedsignature>0x284E0A60</avrdeviceexpectedsignature>
105105
<avrtoolinterfaceclock>10000000</avrtoolinterfaceclock>
106106
<custom>

g2core/gcode_parser.cpp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,37 +1003,38 @@ stat_t _execute_gcode_block(char *active_comment)
10031003
//--> set retract mode goes here
10041004

10051005
switch (gv.next_action) {
1006-
case NEXT_ACTION_SET_G28_POSITION: { status = cm_set_g28_position(); break;} // G28.1
1007-
case NEXT_ACTION_GOTO_G28_POSITION: { status = cm_goto_g28_position(gv.target, gf.target); break;} // G28
1008-
case NEXT_ACTION_SET_G30_POSITION: { status = cm_set_g30_position(); break;} // G30.1
1009-
case NEXT_ACTION_GOTO_G30_POSITION: { status = cm_goto_g30_position(gv.target, gf.target); break;} // G30
1006+
case NEXT_ACTION_SET_G28_POSITION: { status = cm_set_g28_position(); break;} // G28.1
1007+
case NEXT_ACTION_GOTO_G28_POSITION: { status = cm_goto_g28_position(gv.target, gf.target); break;} // G28
1008+
case NEXT_ACTION_SET_G30_POSITION: { status = cm_set_g30_position(); break;} // G30.1
1009+
case NEXT_ACTION_GOTO_G30_POSITION: { status = cm_goto_g30_position(gv.target, gf.target); break;} // G30
10101010

1011-
case NEXT_ACTION_SEARCH_HOME: { status = cm_homing_cycle_start(gv.target, gf.target); break;} // G28.2
1012-
case NEXT_ACTION_SET_ABSOLUTE_ORIGIN: { status = cm_set_absolute_origin(gv.target, gf.target); break;} // G28.3
1013-
case NEXT_ACTION_HOMING_NO_SET: { status = cm_homing_cycle_start_no_set(gv.target, gf.target); break;} // G28.4
1011+
case NEXT_ACTION_SEARCH_HOME: { status = cm_homing_cycle_start(gv.target, gf.target); break;} // G28.2
1012+
case NEXT_ACTION_SET_ABSOLUTE_ORIGIN: { status = cm_set_absolute_origin(gv.target, gf.target); break;} // G28.3
1013+
case NEXT_ACTION_HOMING_NO_SET: { status = cm_homing_cycle_start_no_set(gv.target, gf.target); break;}// G28.4
10141014

10151015
case NEXT_ACTION_STRAIGHT_PROBE_ERR: { status = cm_straight_probe(gv.target, gf.target, true, true); break;} // G38.2
10161016
case NEXT_ACTION_STRAIGHT_PROBE: { status = cm_straight_probe(gv.target, gf.target, true, false); break;} // G38.3
10171017
case NEXT_ACTION_STRAIGHT_PROBE_AWAY_ERR:{ status = cm_straight_probe(gv.target, gf.target, false, true); break;} // G38.4
10181018
case NEXT_ACTION_STRAIGHT_PROBE_AWAY: { status = cm_straight_probe(gv.target, gf.target, false, false); break;}// G38.5
10191019

1020-
case NEXT_ACTION_SET_ORIGIN_OFFSETS: { status = cm_set_origin_offsets(gv.target, gf.target); break;}// G92
1021-
case NEXT_ACTION_RESET_ORIGIN_OFFSETS: { status = cm_reset_origin_offsets(); break;} // G92.1
1022-
case NEXT_ACTION_SUSPEND_ORIGIN_OFFSETS: { status = cm_suspend_origin_offsets(); break;} // G92.2
1023-
case NEXT_ACTION_RESUME_ORIGIN_OFFSETS: { status = cm_resume_origin_offsets(); break;} // G92.3
1020+
case NEXT_ACTION_SET_G10_DATA: { status = cm_set_g10_data(gv.P_word, gf.P_word, gv.L_word, gf.L_word, gv.target, gf.target); break;} // G10
1021+
case NEXT_ACTION_SET_ORIGIN_OFFSETS: { status = cm_set_origin_offsets(gv.target, gf.target); break;} // G92
1022+
case NEXT_ACTION_RESET_ORIGIN_OFFSETS: { status = cm_reset_origin_offsets(); break;} // G92.1
1023+
case NEXT_ACTION_SUSPEND_ORIGIN_OFFSETS: { status = cm_suspend_origin_offsets(); break;} // G92.2
1024+
case NEXT_ACTION_RESUME_ORIGIN_OFFSETS: { status = cm_resume_origin_offsets(); break;} // G92.3
10241025

1025-
case NEXT_ACTION_JSON_COMMAND_SYNC: { status = cm_json_command(active_comment); break;} // M100.0
1026-
case NEXT_ACTION_JSON_COMMAND_ASYNC: { status = cm_json_command_immediate(active_comment); break;} // M100.1
1027-
case NEXT_ACTION_JSON_WAIT: { status = cm_json_wait(active_comment); break;} // M101
1026+
case NEXT_ACTION_JSON_COMMAND_SYNC: { status = cm_json_command(active_comment); break;} // M100.0
1027+
case NEXT_ACTION_JSON_COMMAND_ASYNC: { status = cm_json_command_immediate(active_comment); break;} // M100.1
1028+
case NEXT_ACTION_JSON_WAIT: { status = cm_json_wait(active_comment); break;} // M101
10281029

10291030
case NEXT_ACTION_DEFAULT: {
10301031
cm_set_absolute_override(MODEL, gv.absolute_override); // apply absolute override
10311032
switch (gv.motion_mode) {
1032-
case MOTION_MODE_CANCEL_MOTION_MODE: { cm.gm.motion_mode = gv.motion_mode; break;} // G80
1033+
case MOTION_MODE_CANCEL_MOTION_MODE: { cm.gm.motion_mode = gv.motion_mode; break;} // G80
10331034
case MOTION_MODE_STRAIGHT_TRAVERSE: { status = cm_straight_traverse(gv.target, gf.target); break;} // G0
1034-
case MOTION_MODE_STRAIGHT_FEED: { status = cm_straight_feed(gv.target, gf.target); break;} // G1
1035-
case MOTION_MODE_CW_ARC: // G2
1036-
case MOTION_MODE_CCW_ARC: { status = cm_arc_feed(gv.target, gf.target, // G3
1035+
case MOTION_MODE_STRAIGHT_FEED: { status = cm_straight_feed(gv.target, gf.target); break;} // G1
1036+
case MOTION_MODE_CW_ARC: // G2
1037+
case MOTION_MODE_CCW_ARC: { status = cm_arc_feed(gv.target, gf.target, // G3
10371038
gv.arc_offset, gf.arc_offset,
10381039
gv.arc_radius, gf.arc_radius,
10391040
gv.P_word, gf.P_word,

g2core/marlin_compatibility.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ stat_t marlin_start_tramming_bed(); // G29
4747

4848
stat_t marlin_list_sd_response(); // M20
4949
stat_t marlin_select_sd_response(const char *file); // M23
50-
stat_t marlin_set_extruder_mode(const uint8_t mode); // M82, M82
50+
stat_t marlin_set_extruder_mode(const uint8_t mode); // M82, M82
5151
stat_t marlin_disable_motors(); // M84
5252
stat_t marlin_set_motor_timeout(float s); // M84 Sxxx, M85 Sxxx, M18 Sxxx
5353

g2core/settings/settings_makeblock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
// Communications and reporting settings
5656

57-
#define MARLIN_COMPAT_ENABLED true // enable marlin compatibility mode
57+
#define MARLIN_COMPAT_ENABLED false // enable marlin compatibility mode
5858
#define COMM_MODE JSON_MODE // one of: TEXT_MODE, JSON_MODE
5959
#define XIO_ENABLE_FLOW_CONTROL FLOW_CONTROL_RTS // FLOW_CONTROL_OFF, FLOW_CONTROL_RTS
6060
#define USB_SERIAL_PORTS_EXPOSED 1

g2core/xio.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* xio.cpp - extended IO functions
33
* This file is part of the g2core project
44
*
5-
* Copyright (c) 2013 - 2016 Alden S. Hart Jr.
6-
* Copyright (c) 2013 - 2016 Robert Giseburt
5+
* Copyright (c) 2013 - 2017 Alden S. Hart Jr.
6+
* Copyright (c) 2013 - 2017 Robert Giseburt
77
*
88
* This file ("the software") is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License, version 2 as published by the
@@ -97,7 +97,6 @@ bool checkForNotActive(devflags_t flags_to_check) { return !(flags_to_check & DE
9797
bool checkForCtrlAndData(devflags_t flags_to_check) { return (flags_to_check & (DEV_IS_CTRL|DEV_IS_DATA)) == (DEV_IS_CTRL|DEV_IS_DATA); }
9898
bool checkForCtrlAndPrimary(devflags_t flags_to_check) { return (flags_to_check & (DEV_IS_CTRL|DEV_IS_PRIMARY)) == (DEV_IS_CTRL|DEV_IS_PRIMARY); }
9999

100-
101100
struct xioDeviceWrapperBase { // C++ base class for device primitives
102101
// connection and device management
103102
uint8_t caps; // bitfield for capabilities flags (these are persistent)
@@ -721,23 +720,23 @@ struct LineRXBuffer : RXBuffer<_size, owner_type, char> {
721720

722721
_last_line_length = 0;
723722
}
724-
else if (!_at_start_of_line) { // We only mark ends_line for the first end-line char, and if
725-
ends_line = true; // _at_start_of_line is already true, this is not the first.
723+
else if (!_at_start_of_line) { // We only mark ends_line for the first end-line char, and if
724+
ends_line = true; // _at_start_of_line is already true, this is not the first.
726725
}
727726
}
728-
// prevent going furnther if we are ignoring
727+
// prevent going further if we are ignoring
729728
else if (_ignore_until_next_line)
730729
{
731730
// don't do anything
732731
}
733732
// Classify the line if it's a single character
734733
else if (_at_start_of_line &&
735-
((c == '!') ||
736-
(c == '~') ||
737-
(c == ENQ) || // request ENQ/ack
738-
(c == CHAR_RESET) || // ^X - reset (aka cancel, terminate)
739-
(c == CHAR_ALARM) || // ^D - request job kill (end of transmission)
740-
(c == '%' && cm_has_hold()) // flush (only in feedhold or part of control header)
734+
((c == '!') || // feedhold
735+
(c == '~') || // cycle start
736+
(c == ENQ) || // request ENQ/ack
737+
(c == CHAR_RESET) || // ^X - reset (aka cancel, terminate)
738+
(c == CHAR_ALARM) || // ^D - request job kill (end of transmission)
739+
(c == '%' && cm_has_hold()) // flush (only in feedhold or part of control header)
741740
))
742741
{
743742

g2core/xio.h

100755100644
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* xio.h - extended IO functions
33
* This file is part of the g2core project
44
*
5-
* Copyright (c) 2013 - 2016 Alden S. Hart Jr.
6-
* Copyright (c) 2013 - 2016 Robert Giseburt
5+
* Copyright (c) 2013 - 2017 Alden S. Hart Jr.
6+
* Copyright (c) 2013 - 2017 Robert Giseburt
77
*
88
* This file ("the software") is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License, version 2 as published by the
@@ -48,7 +48,7 @@
4848
#ifndef XIO_H_ONCE
4949
#define XIO_H_ONCE
5050

51-
//#include "g2core.h" // not required if used in g2core project
51+
//#include "g2core.h" // not required if used in g2core project
5252
#include "config.h" // required for nvObj typedef
5353
#include "canonical_machine.h" // needed for cm_has_hold()
5454
#include "settings.h" // needed for MARLIN_COMPAT_ENABLED

0 commit comments

Comments
 (0)