提交 2b9a9e01 编写于 作者: T tangweikang

[components][drivers] update : Move clear_count() function from ops->control()...

[components][drivers] update : Move clear_count() function from ops->control() to ops->clear_count()
上级 e5dc60e3
......@@ -38,6 +38,7 @@ struct rt_encoder_ops
{
rt_err_t (*init)(struct rt_encoder_device *encoder);
rt_int32_t (*get_count)(struct rt_encoder_device *encoder);
rt_err_t (*clear_count)(struct rt_encoder_device *encoder);
rt_err_t (*control)(struct rt_encoder_device *encoder, rt_uint32_t cmd, void *args);
};
......
......@@ -77,12 +77,14 @@ static rt_err_t rt_encoder_control(struct rt_device *dev, int cmd, void *args)
encoder = (struct rt_encoder_device *)dev;
switch (cmd)
{
case ENCODER_CMD_CLEAR_COUNT:
result = encoder->ops->clear_count(encoder);
break;
case ENCODER_CMD_GET_TYPE:
*(enum rt_encoder_type *)args = encoder->type;
break;
case ENCODER_CMD_ENABLE:
case ENCODER_CMD_DISABLE:
case ENCODER_CMD_CLEAR_COUNT:
result = encoder->ops->control(encoder, cmd, args);
break;
default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册