Fix flag test.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 29 Jul 2010 15:17:31 +0000 (15:17 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 29 Jul 2010 15:17:31 +0000 (15:17 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4090 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/avr/drv/i2c_avr.c

index 739e4ab371c3205722956b154f6972a00aaa8a3f..9a1bb14c892c5f8eacf9cfdd4da62cb35707c10d 100644 (file)
@@ -378,7 +378,7 @@ static uint8_t i2c_avr_getc(I2c *i2c)
 
        WAIT_READY();
 
-       if (TW_STATUS != TW_MR_DATA_ACK)
+       if (TW_STATUS != data_flag)
        {
                LOG_ERR("Data nack[%x]\n", TWSR);
                i2c->errors |= I2C_DATA_NACK;