Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[components][drivers][sensor]修复选择sensorv2时产生的编译冲突 #8421

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading