Merge pull request #5109 from thinkyhead/rc_eeprom_M218_tool_offset

Save hotend_offset array (M218) in EEPROM
This commit is contained in:
Scott Lahteine 2016-10-28 20:08:29 -05:00 committed by GitHub
commit 47ad97c35e
4 changed files with 665 additions and 615 deletions

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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