Pretty up TMC current write

This commit is contained in:
Scott Lahteine 2018-01-04 19:47:42 -06:00
parent 3319765034
commit 3ea6745b36

View File

@ -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; //
uint16_t currents[11] = {
#if HAS_TRINAMIC #if HAS_TRINAMIC
#if X_IS_TRINAMIC #if X_IS_TRINAMIC
val = stepperX.getCurrent(); stepperX.getCurrent(),
#else #else
val = 0; 0,
#endif #endif
EEPROM_WRITE(val);
#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
val = stepperZ.getCurrent(); stepperZ.getCurrent(),
#else #else
val = 0; 0,
#endif #endif
EEPROM_WRITE(val);
#if X2_IS_TRINAMIC #if X2_IS_TRINAMIC
val = stepperX2.getCurrent(); stepperX2.getCurrent(),
#else #else
val = 0; 0,
#endif #endif
EEPROM_WRITE(val);
#if Y2_IS_TRINAMIC #if Y2_IS_TRINAMIC
val = stepperY2.getCurrent(); stepperY2.getCurrent(),
#else #else
val = 0; 0,
#endif #endif
EEPROM_WRITE(val);
#if Z2_IS_TRINAMIC #if Z2_IS_TRINAMIC
val = stepperZ2.getCurrent(); stepperZ2.getCurrent(),
#else #else
val = 0; 0,
#endif #endif
EEPROM_WRITE(val);
#if E0_IS_TRINAMIC #if E0_IS_TRINAMIC
val = stepperE0.getCurrent(); stepperE0.getCurrent(),
#else #else
val = 0; 0,
#endif #endif
EEPROM_WRITE(val);
#if E1_IS_TRINAMIC #if E1_IS_TRINAMIC
val = stepperE1.getCurrent(); stepperE1.getCurrent(),
#else #else
val = 0; 0,
#endif #endif
EEPROM_WRITE(val);
#if E2_IS_TRINAMIC #if E2_IS_TRINAMIC
val = stepperE2.getCurrent(); stepperE2.getCurrent(),
#else #else
val = 0; 0,
#endif #endif
EEPROM_WRITE(val);
#if E3_IS_TRINAMIC #if E3_IS_TRINAMIC
val = stepperE3.getCurrent(); stepperE3.getCurrent(),
#else #else
val = 0; 0,
#endif #endif
EEPROM_WRITE(val);
#if E4_IS_TRINAMIC #if E4_IS_TRINAMIC
val = stepperE4.getCurrent(); stepperE4.getCurrent()
#else #else
val = 0; 0
#endif #endif
EEPROM_WRITE(val);
#else #else
val = 0; 0
for (uint8_t q = 11; q--;) EEPROM_WRITE(val);
#endif #endif
};
EEPROM_WRITE(currents);
// //
// TMC2130 Sensorless homing threshold // TMC2130 Sensorless homing threshold