From 79d51581badbb08a528a1f669630d7240da81df2 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 14 Oct 2020 11:44:03 -0700 Subject: [PATCH] Fix digipot compilation (#19731) --- Marlin/src/feature/digipot/digipot.h | 2 +- Marlin/src/feature/digipot/digipot_mcp4018.cpp | 2 ++ Marlin/src/feature/digipot/digipot_mcp4451.cpp | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Marlin/src/feature/digipot/digipot.h b/Marlin/src/feature/digipot/digipot.h index c53f8093dd..3fbd1f3662 100644 --- a/Marlin/src/feature/digipot/digipot.h +++ b/Marlin/src/feature/digipot/digipot.h @@ -30,4 +30,4 @@ public: static void set_current(const uint8_t channel, const float current); }; -DigipotI2C digipot_i2c; +extern DigipotI2C digipot_i2c; diff --git a/Marlin/src/feature/digipot/digipot_mcp4018.cpp b/Marlin/src/feature/digipot/digipot_mcp4018.cpp index 6260185fc3..4b90cc4ead 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4018.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4018.cpp @@ -99,4 +99,6 @@ void DigipotI2C::init() { set_current(i, pgm_read_float(&digipot_motor_current[i])); } +DigipotI2C digipot_i2c; + #endif // DIGIPOT_MCP4018 diff --git a/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin/src/feature/digipot/digipot_mcp4451.cpp index 7e6ace49a0..1b4cf43923 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4451.cpp @@ -95,4 +95,6 @@ void DigipotI2C::init() { set_current(i, pgm_read_float(&digipot_motor_current[i])); } +DigipotI2C digipot_i2c; + #endif // DIGIPOT_MCP4451