mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-22 23:56:13 +01:00
Update I2CManager_NonBlocking.h
Missing initialisation of read buffer pointer!
This commit is contained in:
parent
d6c8595f8a
commit
10cd580061
|
@ -316,6 +316,7 @@ void I2CManagerClass::handleInterrupt() {
|
||||||
deviceAddress = rbAddress;
|
deviceAddress = rbAddress;
|
||||||
sendBuffer = currentRequest->writeBuffer;
|
sendBuffer = currentRequest->writeBuffer;
|
||||||
bytesToSend = currentRequest->writeLen;
|
bytesToSend = currentRequest->writeLen;
|
||||||
|
receiveBuffer = currentRequest->readBuffer;
|
||||||
bytesToReceive = currentRequest->readLen;
|
bytesToReceive = currentRequest->readLen;
|
||||||
operation = currentRequest->operation & OPERATION_MASK;
|
operation = currentRequest->operation & OPERATION_MASK;
|
||||||
state = I2C_STATE_ACTIVE;
|
state = I2C_STATE_ACTIVE;
|
||||||
|
@ -326,6 +327,10 @@ void I2CManagerClass::handleInterrupt() {
|
||||||
// Application request completed, now send epilogue to mux
|
// Application request completed, now send epilogue to mux
|
||||||
overallStatus = completionStatus;
|
overallStatus = completionStatus;
|
||||||
currentRequest->nBytes = rxCount; // Save number of bytes read into rb
|
currentRequest->nBytes = rxCount; // Save number of bytes read into rb
|
||||||
|
if (_muxCount == 1) {
|
||||||
|
// Only one MUX, don't need to deselect subbus
|
||||||
|
muxPhase = MuxPhase_OFF;
|
||||||
|
} else {
|
||||||
muxPhase = MuxPhase_EPILOG;
|
muxPhase = MuxPhase_EPILOG;
|
||||||
deviceAddress = I2C_MUX_BASE_ADDRESS + currentRequest->i2cAddress.muxNumber();
|
deviceAddress = I2C_MUX_BASE_ADDRESS + currentRequest->i2cAddress.muxNumber();
|
||||||
muxData[0] = 0x00;
|
muxData[0] = 0x00;
|
||||||
|
@ -336,6 +341,7 @@ void I2CManagerClass::handleInterrupt() {
|
||||||
state = I2C_STATE_ACTIVE;
|
state = I2C_STATE_ACTIVE;
|
||||||
I2C_sendStart();
|
I2C_sendStart();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
} else if (muxPhase == MuxPhase_EPILOG) {
|
} else if (muxPhase == MuxPhase_EPILOG) {
|
||||||
// Epilog finished, ignore completionStatus
|
// Epilog finished, ignore completionStatus
|
||||||
muxPhase = MuxPhase_OFF;
|
muxPhase = MuxPhase_OFF;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user