fix flow control delay scale

master
Greg Hogan 2018-12-10 20:28:33 -08:00
parent 78f413d88f
commit 48b8dcc6f9
1 changed files with 2 additions and 2 deletions

View File

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