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