summaryrefslogtreecommitdiffstats
path: root/libtoprammer/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'libtoprammer/main.py')
-rw-r--r--libtoprammer/main.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/libtoprammer/main.py b/libtoprammer/main.py
index b0fac2e..965dbd3 100644
--- a/libtoprammer/main.py
+++ b/libtoprammer/main.py
@@ -199,7 +199,15 @@ class TOP(object):
(r"top2049\s+ver\s*(\d+\.\d+)", self.TYPE_TOP2049),
)
- versionString = self.hw.readVersionString()
+ # This is the first hardware access. Try several times since the programmer is in an unknown state.
+ for _ in range(25):
+ try:
+ versionString = self.hw.readVersionString()
+ break
+ except TOPException, e:
+ pass
+ else:
+ raise TOPException("Could not read version string from hardware")
for (regex, t) in versionRegex:
if t != self.topType:
continue
bues.ch cgit interface