mirror of https://github.com/commaai/panda.git
spi: add helper for getting bootloader ID (#2074)
* spi: add helper for getting bootloader ID * fix mypy --------- Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
parent
aab03bc4b6
commit
ae4f753582
|
@ -397,6 +397,9 @@ class STBootloaderSPIHandle(BaseSTBootloaderHandle):
|
|||
data = [struct.pack('>I', address), struct.pack('B', length - 1)]
|
||||
return self._cmd(0x11, data=data, read_bytes=length)
|
||||
|
||||
def get_bootloader_id(self):
|
||||
return self.read(0x1FF1E7FE, 1)
|
||||
|
||||
def get_chip_id(self) -> int:
|
||||
r = self._cmd(0x02, read_bytes=3)
|
||||
assert r[0] == 1 # response length - 1
|
||||
|
|
Loading…
Reference in New Issue