Fix M503 output for M907 motor current (#19777)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
Sten Uusvali
2020-10-17 14:11:22 -07:00
committed by GitHub
parent 178721a329
commit 6fed11896b
5 changed files with 18 additions and 12 deletions

View File

@@ -2962,7 +2962,7 @@ void Stepper::report_positions() {
#if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM
void Stepper::set_digipot_current(const uint8_t driver, const int16_t current) {
if (WITHIN(driver, 0, COUNT(motor_current_setting) - 1))
if (WITHIN(driver, 0, MOTOR_CURRENT_COUNT - 1))
motor_current_setting[driver] = current; // update motor_current_setting
if (!initialized) return;