Implement optional second I2C bus for NRF52840

Enabled at compile-time if WIRE_INFERFACES_COUNT defined as 2
This commit is contained in:
Todd Herbert
2024-09-17 22:12:12 +12:00
committed by todd-herbert
parent 1f8aa1efc7
commit 11598beb16
5 changed files with 13 additions and 9 deletions

View File

@@ -33,7 +33,7 @@ int32_t KbI2cBase::runOnce()
if (!i2cBus) {
switch (cardkb_found.port) {
case ScanI2C::WIRE1:
#ifdef I2C_SDA1
#if defined(I2C_SDA1) || (defined(NRF52840_XXAA) && (WIRE_INTERFACES_COUNT == 2))
LOG_DEBUG("Using I2C Bus 1 (the second one)\n");
i2cBus = &Wire1;
if (cardkb_found.address == BBQ10_KB_ADDR) {