Skip to content

Commit 7f583aa

Browse files
author
valab
committed
Lauterbach bug fixed
1 parent c01b4c3 commit 7f583aa

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

devices.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,15 @@ def __init__(self, name):
276276
rc2 = self.t32api.T32_Attach(T32_DEV)
277277
rc3 = self.t32api.T32_Ping()
278278
if (rc2 != T32_OK or rc3 != T32_OK):
279-
write_to_log("Error while connecting to debug interface, attampt number {}".format(count))
280279
exception_2_raised=1
281280
self.close()
281+
if count == num_of_attempts:
282+
write_to_log("Error- failed to connect to Lautebach after {} attempts".format(count+1))
282283
# Start PRACTICE script - run dvf101_app.cmm
283284
self.t32api.T32_Cmd(b"CD.DO {}".format(T32_APP_CMM_PATH))
284285
time.sleep(2)
285-
286-
286+
287+
287288
def close(self):
288289
self.t32api.T32_Exit()
289290

@@ -310,7 +311,7 @@ def set_bits(self, address, bits_to_set, value_to_set, length="LONG"):
310311
if (self.t32api.T32_Cmd(command) != T32_OK):
311312
write_to_log("error while writing to 0x{}".format(address))
312313

313-
314+
314315
#set to 0 only the specified bits
315316
def clear_bits(self, address, bits_to_clear, length="LONG"):
316317
command = "PER.Set.Field A:{} %{} 0x{} {}".format(address, length ,str(bits_to_set), '0')

0 commit comments

Comments
 (0)