Skip to content

Commit 02c09e6

Browse files
committed
Address Tyeth feedback
1 parent 9f6a088 commit 02c09e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/i2c/hardware.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void I2cHardware::TogglePowerPin() {
6464
void I2cHardware::InitBus(bool is_default, const char *sda, const char *scl) {
6565
uint8_t pin_sda, pin_scl;
6666
if (!is_default && (sda == nullptr || scl == nullptr)) {
67-
_bus_status = wippersnapper_i2c_I2cBusStatus_I2C_BUS_STATUS_ERROR_WIRING;
67+
_bus_status = wippersnapper_i2c_I2cBusStatus_I2C_BUS_STATUS_UNSPECIFIED;
6868
return;
6969
}
7070
// Some development boards define a pin that controls power
@@ -111,7 +111,7 @@ void I2cHardware::InitBus(bool is_default, const char *sda, const char *scl) {
111111
_bus = new TwoWire(0);
112112
} else {
113113
_bus = new TwoWire(1);
114-
Wire1.setPins(pin_sda, pin_scl);
114+
_bus->setPins(pin_sda, pin_scl);
115115
}
116116
if (!_bus->begin(pin_sda, pin_scl)) {
117117
_bus_status = wippersnapper_i2c_I2cBusStatus_I2C_BUS_STATUS_ERROR_HANG;
@@ -159,8 +159,8 @@ TwoWire *I2cHardware::GetBus() { return _bus; }
159159
bool I2cHardware::AddMuxToBus(uint32_t address_register, const char *name) {
160160
if (strcmp(name, "pca9546") == 0) {
161161
_mux_max_channels = 4; // PCA9546 supports 4 channels
162-
} else if (strcmp(name, "pca9548") == 0) {
163-
_mux_max_channels = 4; // PCA9548 supports 4 channels
162+
} else if (strcmp(name, "pca9548") == 0 || strcmp(name, "tca9548a") == 0) {
163+
_mux_max_channels = 8; // PCA9548 supports 8 channels
164164
} else {
165165
return false;
166166
}

0 commit comments

Comments
 (0)