diff --git a/src/detect/ScanI2C.cpp b/src/detect/ScanI2C.cpp index 9c3a18644..03b93e068 100644 --- a/src/detect/ScanI2C.cpp +++ b/src/detect/ScanI2C.cpp @@ -6,7 +6,7 @@ const ScanI2C::FoundDevice ScanI2C::DEVICE_NONE = ScanI2C::FoundDevice(ScanI2C:: ScanI2C::ScanI2C() = default; void ScanI2C::scanPort(ScanI2C::I2CPort port) {} -void ScanI2C::scanPort(ScanI2C::I2CPort port, int *address) {} +void ScanI2C::scanPort(ScanI2C::I2CPort port, uint8_t *address) {} void ScanI2C::setSuppressScreen() { diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 1facb897a..5c75a9dee 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -88,7 +88,7 @@ class ScanI2C ScanI2C(); virtual void scanPort(ScanI2C::I2CPort); - virtual void scanPort(ScanI2C::I2CPort, int *); + virtual void scanPort(ScanI2C::I2CPort, uint8_t *); /* * A bit of a hack, this tells the scanner not to tell later systems there is a screen to avoid enabling it. diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index dd70db8b7..95e273b85 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -135,7 +135,7 @@ uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation type = T; \ break; -void ScanI2CTwoWire::scanPort(I2CPort port, int *address) +void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address) { concurrency::LockGuard guard((concurrency::Lock *)&lock); @@ -163,8 +163,8 @@ void ScanI2CTwoWire::scanPort(I2CPort port, int *address) #endif for (addr.address = 1; addr.address < 127; addr.address++) { - // Skip the address if it is not requested oon a partial scan - if (sizeof(address) > 0 && addr.address != *address) { + // Skip the address if it is not requested on a partial scan + if (address != nullptr && *address != addr.address) { continue; } i2cBus->beginTransmission(addr.address); diff --git a/src/detect/ScanI2CTwoWire.h b/src/detect/ScanI2CTwoWire.h index a7c19c779..332afbf64 100644 --- a/src/detect/ScanI2CTwoWire.h +++ b/src/detect/ScanI2CTwoWire.h @@ -16,7 +16,7 @@ class ScanI2CTwoWire : public ScanI2C public: void scanPort(ScanI2C::I2CPort) override; - void scanPort(ScanI2C::I2CPort, int *) override; + void scanPort(ScanI2C::I2CPort, uint8_t *) override; ScanI2C::FoundDevice find(ScanI2C::DeviceType) const override; diff --git a/src/input/kbI2cBase.cpp b/src/input/kbI2cBase.cpp index 55f435fda..135de1716 100644 --- a/src/input/kbI2cBase.cpp +++ b/src/input/kbI2cBase.cpp @@ -33,7 +33,7 @@ int32_t KbI2cBase::runOnce() if (cardkb_found.address == 0x00) { // Input device is not detected. Rescan now. auto i2cScanner = std::unique_ptr(new ScanI2CTwoWire()); - int i2caddr_scan[] = {CARDKB_ADDR, TDECK_KB_ADDR, BBQ10_KB_ADDR}; + uint8_t i2caddr_scan[] = {CARDKB_ADDR, TDECK_KB_ADDR, BBQ10_KB_ADDR}; #if defined(I2C_SDA1) i2cScanner->scanPort(ScanI2C::I2CPort::WIRE1, i2caddr_scan); #endif