fix i2c flags bug

This commit is contained in:
linch 2019-09-06 14:44:50 +08:00
parent 42248d81e5
commit 55b69111dc
1 changed files with 2 additions and 3 deletions

View File

@ -83,7 +83,7 @@ rt_size_t rt_i2c_master_send(struct rt_i2c_bus_device *bus,
struct rt_i2c_msg msg;
msg.addr = addr;
msg.flags = flags & RT_I2C_ADDR_10BIT;
msg.flags = flags;
msg.len = count;
msg.buf = (rt_uint8_t *)buf;
@ -103,8 +103,7 @@ rt_size_t rt_i2c_master_recv(struct rt_i2c_bus_device *bus,
RT_ASSERT(bus != RT_NULL);
msg.addr = addr;
msg.flags = flags & RT_I2C_ADDR_10BIT;
msg.flags |= RT_I2C_RD;
msg.flags = flags | RT_I2C_RD;
msg.len = count;
msg.buf = buf;