mirror of https://github.com/Desuuuu/klipper.git
tmc_uart: Use nominal mcu frequency in baud calculation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
e872290c47
commit
a61d483e21
|
@ -71,7 +71,7 @@ class MCU_TMC_uart_bitbang:
|
||||||
self.tmcuart_send_cmd = None
|
self.tmcuart_send_cmd = None
|
||||||
self.mcu.register_config_callback(self.build_config)
|
self.mcu.register_config_callback(self.build_config)
|
||||||
def build_config(self):
|
def build_config(self):
|
||||||
bit_ticks = int(self.mcu.get_adjusted_freq() / 9000.)
|
bit_ticks = self.mcu.seconds_to_clock(1. / 9000.)
|
||||||
self.mcu.add_config_cmd(
|
self.mcu.add_config_cmd(
|
||||||
"config_tmcuart oid=%d rx_pin=%s pull_up=%d tx_pin=%s bit_time=%d"
|
"config_tmcuart oid=%d rx_pin=%s pull_up=%d tx_pin=%s bit_time=%d"
|
||||||
% (self.oid, self.rx_pin, self.pullup, self.tx_pin, bit_ticks))
|
% (self.oid, self.rx_pin, self.pullup, self.tx_pin, bit_ticks))
|
||||||
|
|
Loading…
Reference in New Issue