From 182f2cab958f3df70db83efaea26ab6d9574f8d9 Mon Sep 17 00:00:00 2001 From: zylx Date: Fri, 13 Apr 2018 19:40:55 +0800 Subject: [PATCH] [BSP][imxrt1052-evk] fix rt_i2c_transfer bug. --- bsp/imxrt1052-evk/drivers/drv_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp/imxrt1052-evk/drivers/drv_i2c.c b/bsp/imxrt1052-evk/drivers/drv_i2c.c index efe33efa6e..2a3f6805dc 100644 --- a/bsp/imxrt1052-evk/drivers/drv_i2c.c +++ b/bsp/imxrt1052-evk/drivers/drv_i2c.c @@ -294,7 +294,7 @@ static rt_size_t imxrt_i2c_mst_xfer(struct rt_i2c_bus_device *bus, if (rt1052_i2c->msg[i].flags & RT_I2C_RD) { LPI2C_MasterStart(rt1052_i2c->I2C, rt1052_i2c->msg[i].addr, kLPI2C_Read); - if (LPI2C_MasterReceive(rt1052_i2c->I2C, rt1052_i2c->msg->buf, rt1052_i2c->msg->len) == kStatus_LPI2C_Nak) + if (LPI2C_MasterReceive(rt1052_i2c->I2C, rt1052_i2c->msg[i].buf, rt1052_i2c->msg[i].len) == kStatus_LPI2C_Nak) { i = 0; break; @@ -303,7 +303,7 @@ static rt_size_t imxrt_i2c_mst_xfer(struct rt_i2c_bus_device *bus, else { LPI2C_MasterStart(rt1052_i2c->I2C, rt1052_i2c->msg[i].addr, kLPI2C_Write); - if (LPI2C_MasterSend(rt1052_i2c->I2C, rt1052_i2c->msg->buf, rt1052_i2c->msg->len) == kStatus_LPI2C_Nak) + if (LPI2C_MasterSend(rt1052_i2c->I2C, rt1052_i2c->msg[i].buf, rt1052_i2c->msg[i].len) == kStatus_LPI2C_Nak) { i = 0; break;