Fix DAC-related bugs (#19921)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Orel
2020-10-28 03:37:10 +01:00
committed by GitHub
parent c0b4f4eb47
commit e3f1f7cd85
4 changed files with 5 additions and 5 deletions

View File

@ -80,7 +80,7 @@ void GcodeSuite::G34() {
const uint16_t target_current = parser.intval('S', GANTRY_CALIBRATION_CURRENT);
const uint32_t previous_current = stepper.motor_current_setting[Z_AXIS];
stepper.set_digipot_current(1, target_current);
#elif HAS_MOTOR_CURRENT_DAC
#elif ENABLED(HAS_MOTOR_CURRENT_DAC)
const float target_current = parser.floatval('S', GANTRY_CALIBRATION_CURRENT);
const float previous_current = dac_amps(Z_AXIS, target_current);
stepper_dac.set_current_value(Z_AXIS, target_current);
@ -126,7 +126,7 @@ void GcodeSuite::G34() {
stepper.set_digipot_current(Z_AXIS, previous_current);
#elif HAS_MOTOR_CURRENT_PWM
stepper.set_digipot_current(1, previous_current);
#elif HAS_MOTOR_CURRENT_DAC
#elif ENABLED(HAS_MOTOR_CURRENT_DAC)
stepper_dac.set_current_value(Z_AXIS, previous_current);
#elif ENABLED(HAS_MOTOR_CURRENT_I2C)
digipot_i2c.set_current(Z_AXIS, previous_current)