提交 82f981d3 编写于 作者: L luhuadong

[Sensor] Support custom commands for rt_sensor_control

上级 54827949
......@@ -307,7 +307,7 @@ static rt_err_t rt_sensor_control(rt_device_t dev, int cmd, void *args)
case RT_SENSOR_CTRL_GET_ID:
if (args)
{
sensor->ops->control(sensor, RT_SENSOR_CTRL_GET_ID, args);
result = sensor->ops->control(sensor, RT_SENSOR_CTRL_GET_ID, args);
}
break;
case RT_SENSOR_CTRL_GET_INFO:
......@@ -352,7 +352,10 @@ static rt_err_t rt_sensor_control(rt_device_t dev, int cmd, void *args)
result = sensor->ops->control(sensor, RT_SENSOR_CTRL_SELF_TEST, args);
break;
default:
return -RT_ERROR;
/* Custom commands */
result = sensor->ops->control(sensor, cmd, args);
break;
}
if (sensor->module)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册