Skip to content

Commit abefe62

Browse files
committed
send reset command in destructor
The PPK2 was not reset when the object was deleted. The PPK2 is reset with the PPK2 RESET command. This allows a new connection to be established immediately.
1 parent 9894072 commit abefe62

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/ppk2_api/ppk2_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ def __init__(self, port: str, **kwargs):
9898
def __del__(self):
9999
"""Destructor"""
100100
try:
101+
# reset device
102+
self._write_serial((PPK2_Command.RESET,))
103+
101104
if self.ser:
102105
self.ser.close()
103106
except Exception as e:

0 commit comments

Comments
 (0)