Fix return value of rt_dac_write function. (#5816)
Co-authored-by: Wayne Lin <wclin@nuvoton.com>
This commit is contained in:
parent
11344b89d9
commit
615dbe946c
|
@ -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_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_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);
|
rt_err_t rt_dac_disable(rt_dac_device_t dev, rt_uint32_t channel);
|
||||||
|
|
||||||
|
|
|
@ -98,13 +98,11 @@ rt_err_t rt_hw_dac_register(rt_dac_device_t device, const char *name, const stru
|
||||||
return result;
|
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);
|
RT_ASSERT(dev);
|
||||||
|
|
||||||
dev->ops->convert(dev, channel, &value);
|
return dev->ops->convert(dev, channel, &value);
|
||||||
|
|
||||||
return RT_EOK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rt_err_t rt_dac_enable(rt_dac_device_t dev, rt_uint32_t channel)
|
rt_err_t rt_dac_enable(rt_dac_device_t dev, rt_uint32_t channel)
|
||||||
|
|
Loading…
Reference in New Issue