|
|
@ -37,7 +37,7 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
// Change EEPROM version if the structure changes
|
|
|
|
// Change EEPROM version if the structure changes
|
|
|
|
#define EEPROM_VERSION "V68"
|
|
|
|
#define EEPROM_VERSION "V69"
|
|
|
|
#define EEPROM_OFFSET 100
|
|
|
|
#define EEPROM_OFFSET 100
|
|
|
|
|
|
|
|
|
|
|
|
// Check the integrity of data offsets.
|
|
|
|
// Check the integrity of data offsets.
|
|
|
@ -120,7 +120,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_stepper_current_t;
|
|
|
|
typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_stepper_current_t;
|
|
|
|
typedef struct { uint32_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_hybrid_threshold_t;
|
|
|
|
typedef struct { uint32_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_hybrid_threshold_t;
|
|
|
|
typedef struct { int16_t X, Y, Z; } tmc_sgt_t;
|
|
|
|
typedef struct { int16_t X, Y, Z, X2; } tmc_sgt_t;
|
|
|
|
typedef struct { bool X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_stealth_enabled_t;
|
|
|
|
typedef struct { bool X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_stealth_enabled_t;
|
|
|
|
|
|
|
|
|
|
|
|
// Limit an index to an array size
|
|
|
|
// Limit an index to an array size
|
|
|
@ -283,7 +283,7 @@ typedef struct SettingsDataStruct {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
tmc_stepper_current_t tmc_stepper_current; // M906 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5
|
|
|
|
tmc_stepper_current_t tmc_stepper_current; // M906 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5
|
|
|
|
tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5
|
|
|
|
tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5
|
|
|
|
tmc_sgt_t tmc_sgt; // M914 X Y Z
|
|
|
|
tmc_sgt_t tmc_sgt; // M914 X Y Z X2
|
|
|
|
tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5
|
|
|
|
tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -1032,11 +1032,14 @@ void MarlinSettings::postprocess() {
|
|
|
|
// TMC StallGuard threshold
|
|
|
|
// TMC StallGuard threshold
|
|
|
|
//
|
|
|
|
//
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tmc_sgt_t tmc_sgt = { 0, 0, 0 };
|
|
|
|
tmc_sgt_t tmc_sgt = { 0 };
|
|
|
|
#if USE_SENSORLESS
|
|
|
|
#if USE_SENSORLESS
|
|
|
|
#if X_SENSORLESS
|
|
|
|
#if X_SENSORLESS
|
|
|
|
tmc_sgt.X = stepperX.homing_threshold();
|
|
|
|
tmc_sgt.X = stepperX.homing_threshold();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if X2_SENSORLESS
|
|
|
|
|
|
|
|
tmc_sgt.X2 = stepperX2.homing_threshold();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#if Y_SENSORLESS
|
|
|
|
#if Y_SENSORLESS
|
|
|
|
tmc_sgt.Y = stepperY.homing_threshold();
|
|
|
|
tmc_sgt.Y = stepperY.homing_threshold();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1820,10 +1823,13 @@ void MarlinSettings::postprocess() {
|
|
|
|
#if AXIS_HAS_STALLGUARD(X)
|
|
|
|
#if AXIS_HAS_STALLGUARD(X)
|
|
|
|
stepperX.homing_threshold(tmc_sgt.X);
|
|
|
|
stepperX.homing_threshold(tmc_sgt.X);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if AXIS_HAS_STALLGUARD(X2)
|
|
|
|
#if AXIS_HAS_STALLGUARD(X2) && !X2_SENSORLESS
|
|
|
|
stepperX2.homing_threshold(tmc_sgt.X);
|
|
|
|
stepperX2.homing_threshold(tmc_sgt.X);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if X2_SENSORLESS
|
|
|
|
|
|
|
|
stepperX2.homing_threshold(tmc_sgt.X2);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#ifdef Y_STALL_SENSITIVITY
|
|
|
|
#ifdef Y_STALL_SENSITIVITY
|
|
|
|
#if AXIS_HAS_STALLGUARD(Y)
|
|
|
|
#if AXIS_HAS_STALLGUARD(Y)
|
|
|
|
stepperY.homing_threshold(tmc_sgt.Y);
|
|
|
|
stepperY.homing_threshold(tmc_sgt.Y);
|
|
|
|