From 037d6c253bd42584961b9d6c6550ad40ae687776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 13 Nov 2022 11:58:02 +0100 Subject: [PATCH] fix portduino --- src/detect/i2cScan.h | 2 +- src/input/cardKbI2cImpl.cpp | 4 ++++ src/input/kbI2cBase.cpp | 3 +++ src/main.cpp | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/detect/i2cScan.h b/src/detect/i2cScan.h index 8b8bb647b..d44c52199 100644 --- a/src/detect/i2cScan.h +++ b/src/detect/i2cScan.h @@ -221,5 +221,5 @@ void scanI2Cdevice(TwoWire myWire, uint8_t busnum) DEBUG_MSG("%i I2C devices found\n",nDevices); } #else -void scanI2Cdevice(TwoWire myWire, uint8_t busnum) {} +void scanI2Cdevice() {} #endif diff --git a/src/input/cardKbI2cImpl.cpp b/src/input/cardKbI2cImpl.cpp index bef99f4c3..b19820920 100644 --- a/src/input/cardKbI2cImpl.cpp +++ b/src/input/cardKbI2cImpl.cpp @@ -1,6 +1,8 @@ #include "cardKbI2cImpl.h" #include "InputBroker.h" +#if HAS_WIRE + CardKbI2cImpl *cardKbI2cImpl; CardKbI2cImpl::CardKbI2cImpl() : @@ -18,3 +20,5 @@ void CardKbI2cImpl::init() inputBroker->registerSource(this); } + +#endif \ No newline at end of file diff --git a/src/input/kbI2cBase.cpp b/src/input/kbI2cBase.cpp index 7285d3919..5f362f480 100644 --- a/src/input/kbI2cBase.cpp +++ b/src/input/kbI2cBase.cpp @@ -3,6 +3,7 @@ #include "main.h" #include +#if HAS_WIRE KbI2cBase::KbI2cBase(const char *name) : concurrency::OSThread(name) { @@ -120,3 +121,5 @@ int32_t KbI2cBase::runOnce() } return 500; } + +#endif \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 195be3edc..27b16a96b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -247,8 +247,10 @@ void setup() powerStatus->observe(&power->newStatus); power->setup(); // Must be after status handler is installed, so that handler gets notified of the initial configuration +#if HAS_WIRE // We need to scan here to decide if we have a screen for nodeDB.init() scanI2Cdevice(Wire,0); +#endif #ifdef I2C_SDA1 scanI2Cdevice(Wire1,1);