Skip to content

Commit 33fdb76

Browse files
authored
Merge pull request #393 from eblot/sjoerdsimons-guess-device
eeprom: Fall back to device version of type not set in eeprom
2 parents b0aefe7 + 56e6afb commit 33fdb76

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pyftdi/doc/authors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ Contributors
5252
* Roman Dobrodii
5353
* Mark Mentovai
5454
* Alessandro Zini
55+
* Sjoerd Simons

pyftdi/eeprom.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,10 @@ def _decode_eeprom(self):
942942
return
943943
name = None
944944
try:
945-
name = Ftdi.DEVICE_NAMES[cfg['type']].replace('-', '')
945+
type_ = cfg['type']
946+
if type_ == 0:
947+
type_ = self.device_version
948+
name = Ftdi.DEVICE_NAMES[type_].replace('-', '')
946949
if name.startswith('ft'):
947950
name = name[2:]
948951
func = getattr(self, f'_decode_{name}')

0 commit comments

Comments
 (0)