From e585d5246b7391d35a5dc4b1ce2f79a310570f5e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 10 Apr 2021 11:09:57 +0200 Subject: Allow software and hardware i2c to be used together (e.g. on different pins) --- src/driver/Kconfig | 2 ++ src/driver/soft_i2c.cc | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'src/driver') diff --git a/src/driver/Kconfig b/src/driver/Kconfig index dbf70e0..0b1b98b 100644 --- a/src/driver/Kconfig +++ b/src/driver/Kconfig @@ -6,6 +6,8 @@ config meta_driver_adc bool config meta_driver_counter bool +config meta_driver_hardware_i2c +bool config meta_driver_i2c bool config meta_driver_neopixel diff --git a/src/driver/soft_i2c.cc b/src/driver/soft_i2c.cc index 975fa2e..8b87e93 100644 --- a/src/driver/soft_i2c.cc +++ b/src/driver/soft_i2c.cc @@ -235,6 +235,8 @@ ON_TIMER_INTERRUPT_head ON_TIMER_INTERRUPT_tail #endif +#ifndef DRIVER_HARDWARE_I2C + #if SOFTI2C_PULLUP_EXTERNAL #ifdef MULTIPASS_ARCH_msp430fr5969lp SoftI2C i2c(GPIO::p1_6, GPIO::p1_7, GPIO::p1_4, GPIO::p1_5); @@ -258,3 +260,5 @@ SoftI2C i2c(GPIO::p5_0, GPIO::p5_1); SoftI2C i2c(GPIO::px00, GPIO::px01); #endif /* MULTIPASS_ARCH_* */ #endif /* !SOFTI2C_PULLUP_EXTERNAL */ + +#endif /* !DRIVER_HARDWARE_I2C */ -- cgit v1.2.3