Skip to content

Commit 2e36265

Browse files
committed
I/O: Tighten the heuristic for catching 8 bit I2C addresses
1 parent 5385922 commit 2e36265

File tree

1 file changed

+2
-1
lines changed
  • java/libraries/io/src/processing/io

1 file changed

+2
-1
lines changed

java/libraries/io/src/processing/io/I2C.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ protected void finalize() throws Throwable {
9292
* @see endTransmission
9393
*/
9494
public void beginTransmission(int slave) {
95-
if (127 < slave) {
95+
// addresses 120 (0x78) to 127 are additionally reserved
96+
if (0x78 <= slave) {
9697
System.err.println("beginTransmission expects a 7 bit address, try shifting one bit to the right");
9798
throw new IllegalArgumentException("Illegal address");
9899
}

0 commit comments

Comments
 (0)