diff --git a/python/spi.py b/python/spi.py index 988bcd05..699431bf 100644 --- a/python/spi.py +++ b/python/spi.py @@ -17,10 +17,8 @@ from .utils import crc8_pedal try: import spidev - import spidev2 except ImportError: spidev = None - spidev2 = None # Constants SYNC = 0x5A @@ -194,6 +192,7 @@ class PandaSpiHandle(BaseHandle): return dat[3:-1] def _transfer_kernel_driver(self, spi, endpoint: int, data, timeout: int, max_rx_len: int = 1000, expect_disconnect: bool = False) -> bytes: + import spidev2 self.tx_buf[:len(data)] = data self.ioctl_data.endpoint = endpoint self.ioctl_data.tx_length = len(data) diff --git a/requirements.txt b/requirements.txt index 41c5226a..23f2cf9b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,19 +1,17 @@ ruff -libusb1==2.0.1 +libusb1 numpy -hexdump>=3.3 -pycryptodome==3.9.8 +hexdump +pycryptodome tqdm>=4.14.0 pytest pytest-mock pytest-xdist pytest-timeouts parameterized -requests -cffi==1.14.3 -crcmod -pre-commit==2.13.0 -scons==4.4.0 +cffi +pre-commit +scons>=4.4.0 flaky spidev termcolor