From 52f3f3b5ab857fddf27ba97438cd165c816f6f46 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 May 2020 17:00:00 -0500 Subject: [PATCH] Fix motor current array --- Marlin/src/feature/digipot/digipot_mcp4451.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin/src/feature/digipot/digipot_mcp4451.cpp index c3c49f2c8..87c6b679a 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4451.cpp @@ -82,7 +82,13 @@ void digipot_i2c_init() { Wire.begin(); #endif // Set up initial currents as defined in Configuration_adv.h - static const float digipot_motor_current[] PROGMEM = TERN(DIGIPOT_USE_RAW_VALUES, DIGIPOT_MOTOR_CURRENT, DIGIPOT_I2C_MOTOR_CURRENTS); + static const float digipot_motor_current[] PROGMEM = + #if ENABLED(DIGIPOT_USE_RAW_VALUES) + DIGIPOT_MOTOR_CURRENT + #else + DIGIPOT_I2C_MOTOR_CURRENTS + #endif + ; LOOP_L_N(i, COUNT(digipot_motor_current)) digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i])); }