From 9435869ee367221a4b316ae34e8397d14b7dd939 Mon Sep 17 00:00:00 2001 From: Neil McKechnie Date: Tue, 7 Feb 2023 15:04:03 +0000 Subject: [PATCH] Prepare HAL device drivers to support Extended I2C Addresses Cast I2CAddress variables in DIAG calls to (int). --- IODevice.cpp | 2 +- IO_AnalogueInputs.h | 2 +- IO_RotaryEncoder.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/IODevice.cpp b/IODevice.cpp index ea4301f..be26b92 100644 --- a/IODevice.cpp +++ b/IODevice.cpp @@ -322,7 +322,7 @@ bool IODevice::checkNoOverlap(VPIN firstPin, uint8_t nPins, uint8_t i2cAddress) } // Check for overlapping I2C address if (i2cAddress && dev->_I2CAddress==i2cAddress) { - DIAG(F("WARNING HAL Overlap. i2c Addr 0x%x ignored."),i2cAddress); + DIAG(F("WARNING HAL Overlap. i2c Addr 0x%x ignored."),(int)i2cAddress); return false; } } diff --git a/IO_AnalogueInputs.h b/IO_AnalogueInputs.h index 77afc58..a03d90f 100644 --- a/IO_AnalogueInputs.h +++ b/IO_AnalogueInputs.h @@ -131,7 +131,7 @@ private: break; } } else { // error status - DIAG(F("ADS111x I2C:x%d Error:%d %S"), (int)_I2CAddress, status, I2CManager.getErrorMessage(status)); + DIAG(F("ADS111x I2C:x%x Error:%d %S"), (int)_I2CAddress, status, I2CManager.getErrorMessage(status)); _deviceState = DEVSTATE_FAILED; } } diff --git a/IO_RotaryEncoder.h b/IO_RotaryEncoder.h index b4d538c..6de97af 100644 --- a/IO_RotaryEncoder.h +++ b/IO_RotaryEncoder.h @@ -104,7 +104,7 @@ private: } void _display() override { - DIAG(F("Rotary Encoder I2C:x%x v%d.%d.%d Configured on Vpin:%d-%d %S"), _I2CAddress, _majorVer, _minorVer, _patchVer, + DIAG(F("Rotary Encoder I2C:x%x v%d.%d.%d Configured on Vpin:%d-%d %S"), (int)_I2CAddress, _majorVer, _minorVer, _patchVer, (int)_firstVpin, _firstVpin+_nPins-1, (_deviceState==DEVSTATE_FAILED) ? F("OFFLINE") : F("")); }