Browse Source

Merge pull request #5109 from thinkyhead/rc_eeprom_M218_tool_offset

Save hotend_offset array (M218) in EEPROM
pull/1/head
Scott Lahteine 8 years ago
committed by GitHub
parent
commit
47ad97c35e
  1. 4
      Marlin/Marlin.h
  2. 10
      Marlin/Marlin_main.cpp
  3. 1203
      Marlin/configuration_store.cpp
  4. 3
      Marlin/configuration_store.h

4
Marlin/Marlin.h

@ -278,6 +278,10 @@ extern float current_position[NUM_AXIS];
extern float position_shift[XYZ];
extern float home_offset[XYZ];
#if HOTENDS > 1
extern float hotend_offset[XYZ][HOTENDS];
#endif
// Software Endstops
void update_software_endstops(AxisEnum axis);
#if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)

10
Marlin/Marlin_main.cpp

@ -481,13 +481,7 @@ static uint8_t target_extruder;
// Extruder offsets
#if HOTENDS > 1
float hotend_offset[][HOTENDS] = {
HOTEND_OFFSET_X,
HOTEND_OFFSET_Y
#ifdef HOTEND_OFFSET_Z
, HOTEND_OFFSET_Z
#endif
};
float hotend_offset[XYZ][HOTENDS];
#endif
#if HAS_Z_SERVO_ENDSTOP
@ -6129,7 +6123,7 @@ inline void gcode_M211() {
* Z<zoffset> - Available with DUAL_X_CARRIAGE and SWITCHING_EXTRUDER
*/
inline void gcode_M218() {
if (get_target_extruder_from_command(218)) return;
if (get_target_extruder_from_command(218) || target_extruder == 0) return;
if (code_seen('X')) hotend_offset[X_AXIS][target_extruder] = code_value_axis_units(X_AXIS);
if (code_seen('Y')) hotend_offset[Y_AXIS][target_extruder] = code_value_axis_units(Y_AXIS);

1203
Marlin/configuration_store.cpp

File diff suppressed because it is too large

3
Marlin/configuration_store.h

@ -26,6 +26,7 @@
#include "MarlinConfig.h"
void Config_ResetDefault();
void Config_StoreSettings();
#if DISABLED(DISABLE_M503)
void Config_PrintSettings(bool forReplay=false);
@ -34,10 +35,8 @@ void Config_ResetDefault();
#endif
#if ENABLED(EEPROM_SETTINGS)
void Config_StoreSettings();
void Config_RetrieveSettings();
#else
FORCE_INLINE void Config_StoreSettings() {}
FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
#endif

Loading…
Cancel
Save