Skip to content

Commit 6e53673

Browse files
committed
Fix for issue 3
1 parent 6a92d3e commit 6e53673

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/SparkFun_I2C_Mux_Arduino_Library.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,14 @@ bool QWIICMUX::setPort(uint8_t portNumber)
7070

7171
//Returns the first port number bit that is set
7272
//Returns 255 if no port is enabled
73+
//Return 254 if there is an I2C error
7374
uint8_t QWIICMUX::getPort()
7475
{
7576
//Read the current mux settings
7677
//_i2cPort->beginTransmission(_deviceAddress); <- Don't do this!
7778
_i2cPort->requestFrom(_deviceAddress, uint8_t(1));
7879
if (!_i2cPort->available())
79-
return (255); //Error
80+
return (254); //Error
8081
uint8_t portBits = _i2cPort->read();
8182

8283
//Search for the first set bit, then return its location

0 commit comments

Comments
 (0)