SPI: fixes + fake bulk transfers (#1150)

* check spi checkusm

* ugh, fix control handler

* fake bulk xfer

* cleanup

* one more

* unused

* fix linter

* some typing

Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
Adeeb Shihadeh
2022-11-10 21:34:43 -08:00
committed by GitHub
parent a9e0357883
commit 966f7e0539
5 changed files with 67 additions and 21 deletions

View File

@@ -8,6 +8,7 @@ import hashlib
import datetime
import traceback
import warnings
import logging
from functools import wraps
from typing import Optional
from itertools import accumulate
@@ -21,6 +22,11 @@ from .config import DEFAULT_FW_FN, DEFAULT_H7_FW_FN, SECTOR_SIZES_FX, SECTOR_SIZ
__version__ = '0.0.10'
# setup logging
LOGLEVEL = os.environ.get('LOGLEVEL', 'INFO').upper()
logging.basicConfig(level=LOGLEVEL, format='%(message)s')
BASEDIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../")
DEBUG = os.getenv("PANDADEBUG") is not None
@@ -50,7 +56,7 @@ def pack_can_buffer(arr):
snds.append(b'')
idx += 1
#Apply counter to each 64 byte packet
# Apply counter to each 64 byte packet
for idx in range(len(snds)):
tx = b''
counter = 0