Compilation error due to missing DRV_BRAKE_PIN even when TMC4671 driver is commented out
I am working on creating a new target for the f405rgt6, but I don’t have enough pins. As a result, I am cutting off unnecessary components, such as PWM, UART, SPI, and the TMC4671 driver. However, when I try to compile, I encounter the following error:
error: 'DRV_BRAKE_PIN' is not defined
This happens because, even though the TMC4671 driver is commented out, the build process is still looking for the DRV_BRAKE_PIN, which I haven’t defined. The VoltageSense.cpp file should only be compiled when the TMC4671 driver is defined, but it seems that it is being compiled regardless of this condition.
Steps to Reproduce:
Comment out the TMC4671 driver in the target configuration that doesnt have DRV_BRAKE_PIN defined.
Attempt to compile the project.
Observe the compilation error regarding the missing DRV_BRAKE_PIN.
Expected Behavior:
The build process should not look for DRV_BRAKE_PIN when the TMC4671 driver is disabled. The VoltageSense.cpp should only be compiled when TMC4671 is defined.
Possible Solution:
Add conditional compilation to VoltageSense.cpp so that it only compiles when the TMC4671 driver is defined. Alternatively, ensure that any dependencies on DRV_BRAKE_PIN are wrapped in preprocessor conditionals based on the TMC4671 definition.