Skip to content

Commit

Permalink
fix flow control delay scale
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjhogan committed Oct 15, 2019
1 parent 78f413d commit 48b8dcc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/uds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 48b8dcc

Please sign in to comment.