From 5ca2d96b54c618bc822a75f1a5721c06078f3c08 Mon Sep 17 00:00:00 2001 From: Comma Device Date: Tue, 18 Jul 2023 01:06:37 -0700 Subject: [PATCH] python lib: ensure full response is read in remaining --- python/spi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/spi.py b/python/spi.py index f14a04ef..c6f3fd5b 100644 --- a/python/spi.py +++ b/python/spi.py @@ -183,7 +183,7 @@ class PandaSpiHandle(BaseHandle): raise PandaSpiException(f"response length greater than max ({max_rx_len} {response_len})") # read rest - remaining = response_len - preread_len + remaining = (response_len + 1) - preread_len if remaining > 0: dat += bytes(spi.readbytes(remaining))