Skip to content

Commit

Permalink
Remove while (Wire.available() < 1), as requested in #2
Browse files Browse the repository at this point in the history
  • Loading branch information
marcmerlin committed Dec 13, 2017
1 parent f1797ff commit 95f53be
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion IoTuz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ uint8_t IoTuz::i2cexp_read()
// For read to work, we must have sent 1 bits on the ports that get used as input
// This is done by i2cexp_clear_bits called in setup.
Wire.requestFrom(I2C_EXPANDER, 1); // FIXME: deal with returned error here?
while (Wire.available() < 1) ;
uint8_t read = ~Wire.read(); // Apparently one has to invert the bits read
// When no buttons are pushed, this returns 0x91, which includes some ports
// we use as output, so we do need to filter out the ports used as read.
Expand Down

0 comments on commit 95f53be

Please sign in to comment.