mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-03-02 13:15:31 +08:00
Update adc.c
check fun is NULL, error
This commit is contained in:
parent
506ccc573c
commit
895fb5c1a9
@ -46,7 +46,7 @@ static rt_err_t _adc_control(rt_device_t dev, int cmd, void *args)
|
|||||||
rt_err_t result = RT_EOK;
|
rt_err_t result = RT_EOK;
|
||||||
rt_adc_device_t adc = (struct rt_adc_device *)dev;
|
rt_adc_device_t adc = (struct rt_adc_device *)dev;
|
||||||
|
|
||||||
if (adc->ops->enabled != RT_NULL)
|
if (adc->ops->enabled == RT_NULL)
|
||||||
{
|
{
|
||||||
return -RT_ENOSYS;
|
return -RT_ENOSYS;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user