From 964364e51ccde1403ccb2901a50449603aa5438f Mon Sep 17 00:00:00 2001 From: peteGSX <97784652+peteGSX@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:02:35 +1000 Subject: [PATCH] More diags --- I2CManager_Wire.h | 5 ++++- IO_EXIOExpander.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/I2CManager_Wire.h b/I2CManager_Wire.h index d8add75..6d8cf3d 100644 --- a/I2CManager_Wire.h +++ b/I2CManager_Wire.h @@ -193,7 +193,9 @@ uint8_t I2CManagerClass::read(I2CAddress address, uint8_t readBuffer[], uint8_t // while (Wire.available() && nBytes < readSize) while (nBytes < readSize) if (Wire.available()) { + uint8_t temp=nBytes; readBuffer[nBytes++] = Wire.read(); + DIAG(F("nBytes=%d, readBuffer[nBytes]=%d"), temp, readBuffer[temp]); } else { delay(1); } @@ -229,11 +231,12 @@ uint8_t I2CManagerClass::read(I2CAddress address, uint8_t readBuffer[], uint8_t * the non-blocking version. ***************************************************************************/ void I2CManagerClass::queueRequest(I2CRB *req) { + DIAG(F("I2CManagerClass::queueRequest() hit")); if (req==NULL) { DIAG(F("NOOOOOOOOOOO")); return; } - // req->dump(); + req->dump(); switch (req->operation & OPERATION_MASK) { case OPERATION_READ: read(req->i2cAddress, req->readBuffer, req->readLen, NULL, 0, req); diff --git a/IO_EXIOExpander.h b/IO_EXIOExpander.h index c449156..2115b90 100644 --- a/IO_EXIOExpander.h +++ b/IO_EXIOExpander.h @@ -134,12 +134,14 @@ private: // We now need to retrieve the analogue pin map if there are analogue pins if (status == I2C_STATUS_OK && _numAnaloguePins>0) { commandBuffer[0] = EXIOINITA; + DIAG(F("EXIOINITA")); status = I2CManager.read(_I2CAddress, _analoguePinMap, _numAnaloguePins, commandBuffer, 1); } if (status == I2C_STATUS_OK) { // Attempt to get version, if we don't get it, we don't care, don't go offline uint8_t versionBuffer[3]; commandBuffer[0] = EXIOVER; + DIAG(F("EXIOVER")); if (I2CManager.read(_I2CAddress, versionBuffer, sizeof(versionBuffer), commandBuffer, 1) == I2C_STATUS_OK) { _majorVer = versionBuffer[0]; _minorVer = versionBuffer[1];