[sensor] use rt_ssize_t as the return value data type
This commit is contained in:
parent
255020bca8
commit
39b25f660a
|
@ -238,7 +238,7 @@ struct rt_sensor_data
|
|||
|
||||
struct rt_sensor_ops
|
||||
{
|
||||
rt_size_t (*fetch_data)(rt_sensor_t sensor, void *buf, rt_size_t len);
|
||||
rt_ssize_t (*fetch_data)(rt_sensor_t sensor, void *buf, rt_size_t len);
|
||||
rt_err_t (*control)(rt_sensor_t sensor, int cmd, void *arg);
|
||||
};
|
||||
|
||||
|
|
|
@ -123,15 +123,15 @@ static rt_err_t _sensor_irq_init(rt_sensor_t sensor)
|
|||
}
|
||||
|
||||
/* sensor local ops */
|
||||
static rt_size_t _local_fetch_data(rt_sensor_t sensor, void *buf, rt_size_t len)
|
||||
static rt_ssize_t _local_fetch_data(rt_sensor_t sensor, void *buf, rt_size_t len)
|
||||
{
|
||||
LOG_D("Undefined fetch_data");
|
||||
return 0;
|
||||
return -RT_EINVAL;
|
||||
}
|
||||
static rt_err_t _local_control(rt_sensor_t sensor, int cmd, void *arg)
|
||||
{
|
||||
LOG_D("Undefined control");
|
||||
return RT_ERROR;
|
||||
return -RT_EINVAL;
|
||||
}
|
||||
static struct rt_sensor_ops local_ops =
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue