[1.1.x] LIN_ADVANCE v1.5 (#9700)

This commit is contained in:
Sebastianv650
2018-02-23 07:53:41 +01:00
committed by Scott Lahteine
parent e41b2274b0
commit 9c65890644
45 changed files with 774 additions and 1429 deletions

View File

@@ -37,7 +37,7 @@
*/
// Change EEPROM version if the structure changes
#define EEPROM_VERSION "V51"
#define EEPROM_VERSION "V52"
#define EEPROM_OFFSET 100
// Check the integrity of data offsets.
@@ -221,8 +221,7 @@ typedef struct SettingsDataStruct {
//
// LIN_ADVANCE
//
float planner_extruder_advance_k, // M900 K planner.extruder_advance_k
planner_advance_ed_ratio; // M900 WHD planner.advance_ed_ratio
float planner_extruder_advance_K; // M900 K planner.extruder_advance_K
//
// HAS_MOTOR_CURRENT_PWM
@@ -767,15 +766,13 @@ void MarlinSettings::postprocess() {
// Linear Advance
//
_FIELD_TEST(planner_extruder_advance_k);
_FIELD_TEST(planner_extruder_advance_K);
#if ENABLED(LIN_ADVANCE)
EEPROM_WRITE(planner.extruder_advance_k);
EEPROM_WRITE(planner.advance_ed_ratio);
EEPROM_WRITE(planner.extruder_advance_K);
#else
dummy = 0.0f;
EEPROM_WRITE(dummy);
EEPROM_WRITE(dummy);
#endif
_FIELD_TEST(motor_current_setting);
@@ -1305,14 +1302,12 @@ void MarlinSettings::postprocess() {
// Linear Advance
//
_FIELD_TEST(planner_extruder_advance_k);
_FIELD_TEST(planner_extruder_advance_K);
#if ENABLED(LIN_ADVANCE)
EEPROM_READ(planner.extruder_advance_k);
EEPROM_READ(planner.advance_ed_ratio);
EEPROM_READ(planner.extruder_advance_K);
#else
EEPROM_READ(dummy);
EEPROM_READ(dummy);
#endif
//
@@ -1793,8 +1788,7 @@ void MarlinSettings::reset() {
#endif
#if ENABLED(LIN_ADVANCE)
planner.extruder_advance_k = LIN_ADVANCE_K;
planner.advance_ed_ratio = LIN_ADVANCE_E_D_RATIO;
planner.extruder_advance_K = LIN_ADVANCE_K;
#endif
#if HAS_MOTOR_CURRENT_PWM
@@ -2364,8 +2358,7 @@ void MarlinSettings::reset() {
SERIAL_ECHOLNPGM("Linear Advance:");
}
CONFIG_ECHO_START;
SERIAL_ECHOPAIR(" M900 K", planner.extruder_advance_k);
SERIAL_ECHOLNPAIR(" R", planner.advance_ed_ratio);
SERIAL_ECHOLNPAIR(" M900 K", planner.extruder_advance_K);
#endif
#if HAS_MOTOR_CURRENT_PWM