Hi,
during creating a configuration for the BTT SKR Mini E3 v3.0 board for the RatOS distribution I stumbled upon an error
pin y_uart_pin is an alias for x_uart_pin
The RatOS configuration is very structured for supporting many different boards/printers/etc. Due to this, they’re using a pin alias <axis>_uart_pin
for setting the UART pin for each stepper driver, if it supports it.
Then there is a different configuration file tmc2209.cfg
which is valid for all printer/board configurations that are using TMC2209 drivers, where this is used to set the uart_pin
setting of the corresponding tmc2209
sections.
Now, for the BTT SKR Mini E3 v3.0 this pin is the same pin for all drivers since they’re identified by using the uart_address
configuration.
In klippy/pins.py#L45
is a check that ensures that multiple commands that use different aliases to “activate” the same pin cannot be used and results in the above error.
Now, this check leads to this very modular configuration not being possible in this case, only way seems to be to include a override config at the very end to set the uart_pin
of the drivers manually to the correct pin.
I’d like to contribute something that allows me to stay in the modular approach of RatOS and use different aliases for the same pin at different places.
There already is a duplicate_pin_override
and I was wondering if adding such a override for aliases, something like duplicate_pin_alias_override
, would be a practicable way of doing it.
The way I would image it without knowing too much about the Klipper code base would be to add an additional array member to the class PinResolver
that contains a list of pins for which multiple aliases may be used and then adding a check for this new member to the update_command
method to see if multiple aliases for a given pin should result in errors or not - so like the already existent validate_aliases
member but per pin.
Could I get some feedback on if something like this would be able to be merged or not?
Thanks a lot!