From e8e00f69d6d270de8bab24698008efa97d8600cf Mon Sep 17 00:00:00 2001 From: Neil McKechnie Date: Mon, 23 Jan 2023 22:31:33 +0000 Subject: [PATCH] Non-blocking I2C - reset byte counters on timeout. --- I2CManager_NonBlocking.h | 1 + 1 file changed, 1 insertion(+) diff --git a/I2CManager_NonBlocking.h b/I2CManager_NonBlocking.h index c55219a..fce158b 100644 --- a/I2CManager_NonBlocking.h +++ b/I2CManager_NonBlocking.h @@ -196,6 +196,7 @@ void I2CManagerClass::checkForTimeout() { queueHead = t->nextRequest; if (!queueHead) queueTail = NULL; currentRequest = NULL; + bytesToReceive = bytesToSend = 0; // Post request as timed out. t->status = I2C_STATUS_TIMEOUT; // Reset TWI interface so it is able to continue