MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.34k stars 19.26k forks source link

[BUG] last bugfix does not compile when using digipot i2c #17776

Closed Bergerac56 closed 4 years ago

Bergerac56 commented 4 years ago

With bugfix bd82b8bc7ee506d89a99a408fccdad5853ab39b6 I get compile errors when #define DIGIPOT_MCP4451 is activated for a MKS SBASE.: Config files : Marlin.zip

And.. It seems also that the option "AUTO HOME" disapeared from the MOTION sub menu...

Marlin\src\feature\digipot\digipot_mcp4451.cpp: In function 'void digipot_i2c_init()': Compiling .pio\build\LPC1768\src\src\feature\fanmux.cpp.o Marlin\src\feature\digipot\digipot_mcp4451.cpp:85:135: error: expected '}' before ';' token static const float digipot_motor_current[] PROGMEM = TERN(DIGIPOT_USE_RAW_VALUES, DIGIPOT_MOTOR_CURRENT, DIGIPOT_I2C_MOTOR_CURRENTS);

^ In file included from c:\marlin bergerac\marlin\marlin\src\core\boards.h:24, from Marlin\src\feature\digipot../../inc/MarlinConfigPre.h:35, from Marlin\src\feature\digipot../../inc/MarlinConfig.h:28, Compiling .pio\build\LPC1768\src\src\feature\filwidth.cpp.o from Marlin\src\feature\digipot\digipot_mcp4451.cpp:23: c:\marlin bergerac\marlin\marlin\configuration_adv.h:948:38: note: to match this '{'

define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 0.8, 0.8 } // AZTEEG_X3_PRO

                                  ^

c:\marlin bergerac\marlin\marlin\src\core\macros.h:406:26: note: in definition of macro 'THIRD'

define THIRD(a,b,c,...) c

                      ^

c:\marlin bergerac\marlin\marlin\src\core\macros.h:201:29: note: in expansion of macro '___TERN'

define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1'

                         ^~~~~~~

c:\marlin bergerac\marlin\marlin\src\core\macros.h:200:29: note: in expansion of macro '__TERN'

define _TERN(E,V...) __TERN(CAT(T,E),V) // Prepend 'T_' to get 'T_0' or 'T_1'

                         ^~~~~~

c:\marlin bergerac\marlin\marlin\src\core\macros.h:196:29: note: in expansion of macro '_TERN'

define TERN(O,A,B) _TERN(_ENA_1(O),B,A) // OPTION converted to '0' or '1'

                         ^~~~~

Marlin\src\feature\digipot\digipot_mcp4451.cpp:85:56: note: in expansion of macro 'TERN' static const float digipot_motor_current[] PROGMEM = TERN(DIGIPOT_USE_RAW_VALUES, DIGIPOT_MOTOR_CURRENT, DIGIPOT_I2C_MOTOR_CURRENTS); ^~~~ Marlin\src\feature\digipot\digipot_mcp4451.cpp:85:108: note: in expansion of macro 'DIGIPOT_I2C_MOTOR_CURRENTS' static const float digipot_motor_current[] PROGMEM = TERN(DIGIPOT_USE_RAW_VALUES, DIGIPOT_MOTOR_CURRENT, DIGIPOT_I2C_MOTOR_CURRENTS); ^~~~~~ *** [.pio\build\LPC1768\src\src\feature\digipot\digipot_mcp4451.cpp.o] Error 1

Bergerac56 commented 4 years ago

@sjasonsmith Thanks Jason, I will test that

Bergerac56 commented 4 years ago

@sjasonsmith I added your fix in my version of marlin (based on last bugfix for a MKS SBASE) and made some tests.

It compiles and works as expected (modifying the power with M907 for each motor works fine too)

Thanks a lot

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.