Skip to content

Commit

Permalink
[components][drivers][sensor]暂时禁止使用sensorv2框架
Browse files Browse the repository at this point in the history
sensor v2框架仍在开发中
  • Loading branch information
yangpengya authored and mysterywolf committed Dec 26, 2023
1 parent 0bf7adf commit 9effd09
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions components/drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,9 @@ config RT_USING_SENSOR
default n

if RT_USING_SENSOR
config RT_USING_SENSOR_V2
bool "Enable Sensor Framework v2"
default n
# config RT_USING_SENSOR_V2
# bool "Enable Sensor Framework v2"
# default n

config RT_USING_SENSOR_CMD
bool "Using Sensor cmd"
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/include/drivers/sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ struct rt_sensor_data

struct rt_sensor_ops
{
rt_size_t (*fetch_data)(struct rt_sensor_device *sensor, void *buf, rt_size_t len);
rt_ssize_t (*fetch_data)(struct rt_sensor_device *sensor, void *buf, rt_size_t len);
rt_err_t (*control)(struct rt_sensor_device *sensor, int cmd, void *arg);
};

Expand Down
4 changes: 2 additions & 2 deletions components/drivers/sensor/v1/sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ static rt_err_t rt_sensor_irq_init(rt_sensor_t sensor)

// local rt_sensor_ops

static rt_size_t local_fetch_data(struct rt_sensor_device *sensor, void *buf, rt_size_t len)
static rt_ssize_t local_fetch_data(struct rt_sensor_device *sensor, void *buf, rt_size_t len)
{
LOG_D("Undefined fetch_data");
return 0;
}
static rt_err_t local_control(struct rt_sensor_device *sensor, int cmd, void *arg)
{
LOG_D("Undefined control");
return RT_ERROR;
return -RT_ERROR;
}
static struct rt_sensor_ops local_ops =
{
Expand Down

0 comments on commit 9effd09

Please sign in to comment.