Pretty up TMC current write

2.0.x
Scott Lahteine 7 years ago
parent 3319765034
commit 3ea6745b36

@ -562,79 +562,71 @@ void MarlinSettings::postprocess() {
#endif #endif
//
// Save TMC2130 or TMC2208 Configuration, and placeholder values // Save TMC2130 or TMC2208 Configuration, and placeholder values
uint16_t val; //
#if HAS_TRINAMIC uint16_t currents[11] = {
#if X_IS_TRINAMIC #if HAS_TRINAMIC
val = stepperX.getCurrent(); #if X_IS_TRINAMIC
#else stepperX.getCurrent(),
val = 0; #else
#endif 0,
EEPROM_WRITE(val); #endif
#if Y_IS_TRINAMIC #if Y_IS_TRINAMIC
val = stepperY.getCurrent(); stepperY.getCurrent(),
#else #else
val = 0; 0,
#endif #endif
EEPROM_WRITE(val); #if Z_IS_TRINAMIC
#if Z_IS_TRINAMIC stepperZ.getCurrent(),
val = stepperZ.getCurrent(); #else
#else 0,
val = 0; #endif
#endif #if X2_IS_TRINAMIC
EEPROM_WRITE(val); stepperX2.getCurrent(),
#if X2_IS_TRINAMIC #else
val = stepperX2.getCurrent(); 0,
#else #endif
val = 0; #if Y2_IS_TRINAMIC
#endif stepperY2.getCurrent(),
EEPROM_WRITE(val); #else
#if Y2_IS_TRINAMIC 0,
val = stepperY2.getCurrent(); #endif
#else #if Z2_IS_TRINAMIC
val = 0; stepperZ2.getCurrent(),
#endif #else
EEPROM_WRITE(val); 0,
#if Z2_IS_TRINAMIC #endif
val = stepperZ2.getCurrent(); #if E0_IS_TRINAMIC
#else stepperE0.getCurrent(),
val = 0; #else
#endif 0,
EEPROM_WRITE(val); #endif
#if E0_IS_TRINAMIC #if E1_IS_TRINAMIC
val = stepperE0.getCurrent(); stepperE1.getCurrent(),
#else #else
val = 0; 0,
#endif #endif
EEPROM_WRITE(val); #if E2_IS_TRINAMIC
#if E1_IS_TRINAMIC stepperE2.getCurrent(),
val = stepperE1.getCurrent(); #else
#else 0,
val = 0; #endif
#endif #if E3_IS_TRINAMIC
EEPROM_WRITE(val); stepperE3.getCurrent(),
#if E2_IS_TRINAMIC #else
val = stepperE2.getCurrent(); 0,
#else #endif
val = 0; #if E4_IS_TRINAMIC
#endif stepperE4.getCurrent()
EEPROM_WRITE(val); #else
#if E3_IS_TRINAMIC 0
val = stepperE3.getCurrent(); #endif
#else
val = 0;
#endif
EEPROM_WRITE(val);
#if E4_IS_TRINAMIC
val = stepperE4.getCurrent();
#else #else
val = 0; 0
#endif #endif
EEPROM_WRITE(val); };
#else EEPROM_WRITE(currents);
val = 0;
for (uint8_t q = 11; q--;) EEPROM_WRITE(val);
#endif
// //
// TMC2130 Sensorless homing threshold // TMC2130 Sensorless homing threshold

Loading…
Cancel
Save