Skip to content
Snippets Groups Projects
Commit 442d1735 authored by Martin Teichmann's avatar Martin Teichmann
Browse files

support terminals that only read 4 eeprom bytes

some terminals do not support reading 8 bytes of the eeprom at
a time, we have to limit to 4 bytes at a time
parent 02692cca
No related branches found
No related tags found
2 merge requests!9support Leybold turbo pump,!8Draft: move the index field to the end of packet
...@@ -582,7 +582,13 @@ class Terminal: ...@@ -582,7 +582,13 @@ class Terminal:
busy = 0x8000 busy = 0x8000
while busy & 0x8000: while busy & 0x8000:
busy, data = await self.read(0x502, "H4x8s") busy, data = await self.read(0x502, "H4x8s")
return data if busy & 0x40: # otherwise we actually only read 4 bytes
return data
await self.write(0x502, "HI", 0x100, start + 2)
busy = 0x8000
while busy & 0x8000:
busy, data2 = await self.read(0x502, "H4x4s")
return data[:4] + data2
async def eeprom_write_one(self, start, data): async def eeprom_write_one(self, start, data):
"""read 2 bytes from the eeprom at `start`""" """read 2 bytes from the eeprom at `start`"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment