tmc_uart: Make sure address is at least 0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
a730aec8bc
commit
c356e8362d
|
@ -175,7 +175,7 @@ def lookup_tmc_uart_bitbang(config, max_addr):
|
||||||
if rx_pin_params['chip'] is not tx_pin_params['chip']:
|
if rx_pin_params['chip'] is not tx_pin_params['chip']:
|
||||||
raise ppins.error("TMC uart rx and tx pins must be on the same mcu")
|
raise ppins.error("TMC uart rx and tx pins must be on the same mcu")
|
||||||
select_pins_desc = config.get('select_pins', None)
|
select_pins_desc = config.get('select_pins', None)
|
||||||
addr = config.getint('uart_address', 0, maxval=max_addr)
|
addr = config.getint('uart_address', 0, minval=0, maxval=max_addr)
|
||||||
mcu_uart = rx_pin_params.get('class')
|
mcu_uart = rx_pin_params.get('class')
|
||||||
if mcu_uart is None:
|
if mcu_uart is None:
|
||||||
mcu_uart = MCU_TMC_uart_bitbang(rx_pin_params, tx_pin_params,
|
mcu_uart = MCU_TMC_uart_bitbang(rx_pin_params, tx_pin_params,
|
||||||
|
|
Loading…
Reference in New Issue