From 48b8dcc6f9913b8d86fa1c940f7ec9fb5d62f7b9 Mon Sep 17 00:00:00 2001 From: Greg Hogan Date: Mon, 10 Dec 2018 20:28:33 -0800 Subject: [PATCH] fix flow control delay scale --- python/uds.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/uds.py b/python/uds.py index 176ad003cd695b..3dac81f871c8fc 100644 --- a/python/uds.py +++ b/python/uds.py @@ -152,8 +152,8 @@ def _isotp_thread(panda, bus, tx_addr, tx_queue, rx_queue): # TODO: support wait/overflow assert rx_data[0] == 0x30, "tx: flow-control requires: continue" delay_ts = ord(rx_data[2]) & 0x7F - # milliseconds if first bit == 0, micro seconds if first bit == 1 - delay_div = 1000. if ord(rx_data[2]) & 0x80 == 0 else 100000. + # scale is 1 milliseconds if first bit == 0, 100 micro seconds if first bit == 1 + delay_div = 1000. if ord(rx_data[2]) & 0x80 == 0 else 10000. # first frame = 6 bytes, each consecutive frame = 7 bytes start = 6 + tx_frame["idx"] * 7 count = rx_data[1]