Fix return value of rt_dac_write function. (#5816)

Co-authored-by: Wayne Lin <wclin@nuvoton.com>
This commit is contained in:
Wayne 2022-04-15 17:09:37 +08:00 committed by GitHub
parent 11344b89d9
commit 615dbe946c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -35,7 +35,7 @@ typedef enum
rt_err_t rt_hw_dac_register(rt_dac_device_t dac,const char *name, const struct rt_dac_ops *ops, const void *user_data);
rt_uint32_t rt_dac_write(rt_dac_device_t dev, rt_uint32_t channel, rt_uint32_t value);
rt_err_t rt_dac_write(rt_dac_device_t dev, rt_uint32_t channel, rt_uint32_t value);
rt_err_t rt_dac_enable(rt_dac_device_t dev, rt_uint32_t channel);
rt_err_t rt_dac_disable(rt_dac_device_t dev, rt_uint32_t channel);

View File

@ -98,13 +98,11 @@ rt_err_t rt_hw_dac_register(rt_dac_device_t device, const char *name, const stru
return result;
}
rt_uint32_t rt_dac_write(rt_dac_device_t dev, rt_uint32_t channel, rt_uint32_t value)
rt_err_t rt_dac_write(rt_dac_device_t dev, rt_uint32_t channel, rt_uint32_t value)
{
RT_ASSERT(dev);
dev->ops->convert(dev, channel, &value);
return RT_EOK;
return dev->ops->convert(dev, channel, &value);
}
rt_err_t rt_dac_enable(rt_dac_device_t dev, rt_uint32_t channel)