Commit 030bc2db authored by MagoKimbra's avatar MagoKimbra

Fix hotend_offset

parent 64c7305f
......@@ -168,7 +168,7 @@
//#define Y_DUAL_STEPPER_DRIVERS
// Define if the two Y drives need to rotate in opposite directions
#define INVERT_Y2_VS_Y_DIR true
#define INVERT_Y2_VS_Y_DIR false
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
......@@ -183,7 +183,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
// However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
// However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
......
......@@ -147,6 +147,7 @@
* M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
* Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
* IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
* M110 - Set current line number.
* M111 - Set debug flags with S<mask>. See flag bits defined in Marlin.h.
* M112 - Emergency stop
* M114 - Output current position to serial port, (V)erbose for user
......@@ -876,9 +877,16 @@ void get_command() {
char *apos = strchr(command, '*');
if (npos) {
gcode_N = strtol(npos + 1, NULL, 10);
if (gcode_N != gcode_LastN + 1 && strstr_P(command, PSTR("M110")) == NULL) {
gcode_line_error(PSTR(MSG_ERR_LINE_NO));
return;
if (gcode_N != gcode_LastN + 1) {
if (strstr_P(command, PSTR("M110")) == NULL) {
gcode_line_error(PSTR(MSG_ERR_LINE_NO));
return;
}
else {
npos = strchr(npos, 'N');
gcode_N = strtol(npos + 1, NULL, 10);
gcode_LastN = gcode_N;
}
}
if (apos) {
......@@ -5722,10 +5730,10 @@ inline void gcode_M503() {
if (code_seen('X')) duplicate_hotend_x_offset = max(code_value(), X2_MIN_POS - x_home_pos(0));
if (code_seen('R')) duplicate_extruder_temp_offset = code_value();
ECHO_SM(DB, MSG_HOTEND_OFFSET);
ECHO_MV(" ", extruder_offset[X_AXIS][0]);
ECHO_MV(",", extruder_offset[Y_AXIS][0]);
ECHO_MV(" ", hotend_offset[X_AXIS][0]);
ECHO_MV(",", hotend_offset[Y_AXIS][0]);
ECHO_MV(" ", duplicate_hotend_x_offset);
ECHO_EMV(",", extruder_offset[Y_AXIS][1]);
ECHO_EMV(",", hotend_offset[Y_AXIS][1]);
break;
case DXC_FULL_CONTROL_MODE:
case DXC_AUTO_PARK_MODE:
......
......@@ -454,14 +454,14 @@ void Config_ResetDefault() {
#if HOTENDS > 1
max_i = sizeof(tmp9) / sizeof(*tmp9);
if(i < max_i)
extruder_offset[X_AXIS][i] = tmp9[i];
hotend_offset[X_AXIS][i] = tmp9[i];
else
extruder_offset[X_AXIS][i] = 0;
hotend_offset[X_AXIS][i] = 0;
max_i = sizeof(tmp10) / sizeof(*tmp10);
if(i < max_i)
extruder_offset[Y_AXIS][i] = tmp10[i];
hotend_offset[Y_AXIS][i] = tmp10[i];
else
extruder_offset[Y_AXIS][i] = 0;
hotend_offset[Y_AXIS][i] = 0;
#endif // HOTENDS > 1
}
}
......
......@@ -2474,7 +2474,7 @@
#endif
#if NUM_SERVOS > 0
#define SERVO0_PIN -1
#define SERVO0_PIN -1
#endif
#if NUM_SERVOS > 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment