tmc_uart: Make sure address is at least 0

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-07-31 13:13:27 -04:00
parent a730aec8bc
commit c356e8362d
1 changed files with 1 additions and 1 deletions

View File

@ -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,