From f807339eecaf1ab513c48fc999f701ad60f4bcc5 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sat, 15 Jan 2022 20:21:28 +0100 Subject: [PATCH] suggested code readability improvement by compiler warning --- I2CManager_Mega4809.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/I2CManager_Mega4809.h b/I2CManager_Mega4809.h index 551b4f9..a8254a9 100644 --- a/I2CManager_Mega4809.h +++ b/I2CManager_Mega4809.h @@ -72,7 +72,7 @@ void I2CManagerClass::I2C_sendStart() { bytesToReceive = currentRequest->readLen; // If anything to send, initiate write. Otherwise initiate read. - if (operation == OPERATION_READ || (operation == OPERATION_REQUEST & !bytesToSend)) + if (operation == OPERATION_READ || ((operation == OPERATION_REQUEST) & !bytesToSend)) TWI0.MADDR = (currentRequest->i2cAddress << 1) | 1; else TWI0.MADDR = (currentRequest->i2cAddress << 1) | 0; @@ -157,4 +157,4 @@ ISR(TWI0_TWIM_vect) { I2CManagerClass::handleInterrupt(); } -#endif \ No newline at end of file +#endif