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.33k stars 19.25k forks source link

[BUG] E_DUAL_STEPPER_DRIVERS code order issue #25787

Open ellensp opened 1 year ago

ellensp commented 1 year ago

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

E_DUAL_STEPPER_DRIVERS is set In Configuration_adv.h, but Conditionals_LCD.h is called before Configuration_adv.h

In Conditionals_LCD.h is: https://github.com/MarlinFirmware/Marlin/blob/181a57ae9b1899d2c7fe4170827adcff1d569bd4/Marlin/src/inc/Conditionals_LCD.h#L116-L119

Which can never be true as a this point the code has not set E_DUAL_STEPPER_DRIVERS

thisiskeithb edit: Symptoms include E1 operating in standalone mode with incorrect microstepping, etc.

Bug Timeline

Unknown

Expected behavior

E_DUAL_STEPPER_DRIVERS should set:

  #define E_STEPPERS      2
  #define E_MANUAL        1

Actual behavior

It does not set these defines.

Steps to Reproduce

  1. get current bugfix
  2. enable #define E1_DRIVER_TYPE A4988
  3. enable #define E_DUAL_STEPPER_DRIVERS In Configuration_adv.h
  4. As a simple test add #error "should error" under #if ENABLED(E_DUAL_STEPPER_DRIVERS) in Conditionals_LCD.h
  5. build. If it was working as expected it would now error on this #error. It does not.

That block of code is also greyed out, but you cant always relay on intellisense, but in this case it is correct. The block is not enabled.

Version of Marlin Firmware

bugfix-2.1.x

Don't forget to include

Additional information & file uploads

Configuration.zip

ellensp commented 1 year ago

Further if you add #define E_DUAL_STEPPER_DRIVERS to Configuration.h so that the following is set:

#define E_STEPPERS 2
#define E_MANUAL 1

Then in indirection.h the following block is not run: https://github.com/MarlinFirmware/Marlin/blob/181a57ae9b1899d2c7fe4170827adcff1d569bd4/Marlin/src/module/stepper/indirection.h#L710-L713

as the #elif E_STEPPERS > 1 block above it is selected instead