summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authoryangpeng <[email protected]>2023-12-26 14:36:40 +0800
committerMeco Man <[email protected]>2023-12-26 20:32:28 +0800
commitff1bd3807ccba406f836cd81e20088e4d9c331e7 (patch)
tree945c543ea5ca7818851cb2132a3e4241a622e5a7 /components
parentf4c05e3cc357142005eabc3769e4b0c71732dc3c (diff)
[components][drivers][sensor]暂时禁止使用sensorv2框架
sensor v2框架仍在开发中
Diffstat (limited to 'components')
-rwxr-xr-xcomponents/drivers/Kconfig6
-rw-r--r--components/drivers/include/drivers/sensor.h2
-rw-r--r--components/drivers/sensor/v1/sensor.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/components/drivers/Kconfig b/components/drivers/Kconfig
index 0a1db41bf9..8b9467008e 100755
--- a/components/drivers/Kconfig
+++ b/components/drivers/Kconfig
@@ -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"
diff --git a/components/drivers/include/drivers/sensor.h b/components/drivers/include/drivers/sensor.h
index e09d8d8c94..6c8b78e8a5 100644
--- a/components/drivers/include/drivers/sensor.h
+++ b/components/drivers/include/drivers/sensor.h
@@ -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);
};
diff --git a/components/drivers/sensor/v1/sensor.c b/components/drivers/sensor/v1/sensor.c
index 0bf5a62638..6da12f9342 100644
--- a/components/drivers/sensor/v1/sensor.c
+++ b/components/drivers/sensor/v1/sensor.c
@@ -127,7 +127,7 @@ 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;
@@ -135,7 +135,7 @@ static rt_size_t local_fetch_data(struct rt_sensor_device *sensor, void *buf, rt
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 =
{