[compoents][hwtimer]Add a user control interface
This commit is contained in:
parent
bceb6635b0
commit
a837f2b8e9
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
* Copyright (c) 2006-2024 RT-Thread Development Team
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
|
@ -320,7 +320,14 @@ static rt_err_t rt_hwtimer_control(struct rt_device *dev, int cmd, void *args)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
result = -RT_ENOSYS;
|
if (timer->ops->control != RT_NULL)
|
||||||
|
{
|
||||||
|
result = timer->ops->control(timer, cmd, args);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = -RT_ENOSYS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue