1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-30 03:26:13 +01:00

Prepare HAL device drivers to support Extended I2C Addresses

Cast I2CAddress variables in DIAG calls to (int).
This commit is contained in:
Neil McKechnie 2023-02-07 15:04:03 +00:00
parent d5a394d4e6
commit 9435869ee3
3 changed files with 3 additions and 3 deletions

View File

@ -322,7 +322,7 @@ bool IODevice::checkNoOverlap(VPIN firstPin, uint8_t nPins, uint8_t i2cAddress)
} }
// Check for overlapping I2C address // Check for overlapping I2C address
if (i2cAddress && dev->_I2CAddress==i2cAddress) { 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; return false;
} }
} }

View File

@ -131,7 +131,7 @@ private:
break; break;
} }
} else { // error status } 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; _deviceState = DEVSTATE_FAILED;
} }
} }

View File

@ -104,7 +104,7 @@ private:
} }
void _display() override { 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("")); (int)_firstVpin, _firstVpin+_nPins-1, (_deviceState==DEVSTATE_FAILED) ? F("OFFLINE") : F(""));
} }