Skip to content

Commit

Permalink
Fix I2C peripheral scanning
Browse files Browse the repository at this point in the history
Sending STOP immediately after a READ address is illegal and puts the
peripheral in an undefined state.
  • Loading branch information
bessman committed Jan 5, 2025
1 parent 90bccef commit 05c135d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pslab/bus/i2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def ping(self) -> bool:
response : bool
True is slave responded, False otherwise.
"""
response = self._start(self.address, self._READ)
response = self._start(self.address, self._WRITE)
self._stop()

return response == self._ACK
Expand Down

0 comments on commit 05c135d

Please sign in to comment.