Skip to content

Commit 49e1bce

Browse files
committed
Commenting redundant beginTransmission before requestFrom. Possible fix for the slippery mux bug?
1 parent 815fe79 commit 49e1bce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SparkFun_I2C_Mux_Arduino_Library.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bool QWIICMUX::setPort(uint8_t portNumber)
7373
uint8_t QWIICMUX::getPort()
7474
{
7575
//Read the current mux settings
76-
_i2cPort->beginTransmission(_deviceAddress);
76+
//_i2cPort->beginTransmission(_deviceAddress); <- Don't do this!
7777
_i2cPort->requestFrom(_deviceAddress, 1);
7878
if (!_i2cPort->available())
7979
return (255); //Error
@@ -105,7 +105,7 @@ bool QWIICMUX::setPortState(uint8_t portBits)
105105
uint8_t QWIICMUX::getPortState()
106106
{
107107
//Read the current mux settings
108-
_i2cPort->beginTransmission(_deviceAddress);
108+
//_i2cPort->beginTransmission(_deviceAddress); <- Don't do this!
109109
_i2cPort->requestFrom(_deviceAddress, 1);
110110
return (_i2cPort->read());
111111
}
@@ -138,4 +138,4 @@ bool QWIICMUX::disablePort(uint8_t portNumber)
138138
settings &= ~(1 << portNumber);
139139

140140
return (setPortState(settings));
141-
}
141+
}

0 commit comments

Comments
 (0)