mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-29 10:30:24 +00:00
Fix some compilation warning (#5744)
* Fix some compilation warning * 补充修正一些数据类型的使用错误 Co-authored-by: Meco Man <920369182@qq.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
@@ -404,7 +404,9 @@ static rt_size_t i2c_bit_xfer(struct rt_i2c_bus_device *bus,
|
||||
{
|
||||
ret = i2c_recv_bytes(bus, msg);
|
||||
if (ret >= 1)
|
||||
{
|
||||
LOG_D("read %d byte%s", ret, ret == 1 ? "" : "s");
|
||||
}
|
||||
if (ret < msg->len)
|
||||
{
|
||||
if (ret >= 0)
|
||||
@@ -416,7 +418,9 @@ static rt_size_t i2c_bit_xfer(struct rt_i2c_bus_device *bus,
|
||||
{
|
||||
ret = i2c_send_bytes(bus, msg);
|
||||
if (ret >= 1)
|
||||
{
|
||||
LOG_D("write %d byte%s", ret, ret == 1 ? "" : "s");
|
||||
}
|
||||
if (ret < msg->len)
|
||||
{
|
||||
if (ret >= 0)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
@@ -108,7 +108,7 @@ rt_size_t rt_i2c_master_send(struct rt_i2c_bus_device *bus,
|
||||
const rt_uint8_t *buf,
|
||||
rt_uint32_t count)
|
||||
{
|
||||
rt_err_t ret;
|
||||
rt_size_t ret;
|
||||
struct rt_i2c_msg msg;
|
||||
|
||||
msg.addr = addr;
|
||||
@@ -127,7 +127,7 @@ rt_size_t rt_i2c_master_recv(struct rt_i2c_bus_device *bus,
|
||||
rt_uint8_t *buf,
|
||||
rt_uint32_t count)
|
||||
{
|
||||
rt_err_t ret;
|
||||
rt_size_t ret;
|
||||
struct rt_i2c_msg msg;
|
||||
RT_ASSERT(bus != RT_NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user