Skip to content

Commit

Permalink
Handle re-opening a closed bus
Browse files Browse the repository at this point in the history
Set address and _force_last to their initial values to be able
to handle an open -> close -> open sequence.
  • Loading branch information
henrik-nil-acc committed Mar 19, 2024
1 parent 00e8909 commit af3f693
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions smbus2/smbus2.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ def close(self):
os.close(self.fd)
self.fd = None
self._pec = 0
self.address = None
self._force_last = None

def _get_pec(self):
return self._pec
Expand Down

0 comments on commit af3f693

Please sign in to comment.