Skip to content

Commit 05c135d

Browse files
bessmanAlexander Bessman
authored andcommitted
Fix I2C peripheral scanning
Sending STOP immediately after a READ address is illegal and puts the peripheral in an undefined state.
1 parent 90bccef commit 05c135d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pslab/bus/i2c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def ping(self) -> bool:
515515
response : bool
516516
True is slave responded, False otherwise.
517517
"""
518-
response = self._start(self.address, self._READ)
518+
response = self._start(self.address, self._WRITE)
519519
self._stop()
520520

521521
return response == self._ACK

0 commit comments

Comments
 (0)