Fix PCA9548ACom not restoring address when the underlying I2C call fails
The PCA9548ACom works as follows, with com
pointing to the PCA9548A device.
- Enable only PCA9548A's
channel
output - Change
com
target device address todeviceAddr
- Perform requested I2C operation using
com
- Restore
com
target device address to PCA9548A
If step 3 fails, then the function aborts and the PCA9548A address is never restored to the internal com
object. This fixes it by catching the step 3 exception and restoring the mux address before throwing it again.
Also adds documentation on how the class works.