summaryrefslogtreecommitdiff
path: root/components/drivers/hwtimer/hwtimer.c
diff options
context:
space:
mode:
authorMan, Jianting (Meco) <[email protected]>2022-05-09 10:59:27 -0400
committerGitHub <[email protected]>2022-05-09 22:59:27 +0800
commit0d2b96d7cc8c1cf52a6a86a4004777baada6794f (patch)
tree49492e0d1e817a174066021102ef8c92acc91ba5 /components/drivers/hwtimer/hwtimer.c
parent96dd783f37d44556c8d470a13b45b6bd4e28ac2c (diff)
[stm32][l4] add tim7 support | 设备框架以及驱动错误码处理逻辑存在问题 (#5901)
Diffstat (limited to 'components/drivers/hwtimer/hwtimer.c')
-rw-r--r--components/drivers/hwtimer/hwtimer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/components/drivers/hwtimer/hwtimer.c b/components/drivers/hwtimer/hwtimer.c
index c1a7b75ecc..73a467fabb 100644
--- a/components/drivers/hwtimer/hwtimer.c
+++ b/components/drivers/hwtimer/hwtimer.c
@@ -8,10 +8,13 @@
* 2015-08-31 heyuanjie87 first version
*/
-#include <rtthread.h>
#include <rtdevice.h>
#include <rthw.h>
+#define DBG_TAG "hwtimer"
+#define DBG_LVL DBG_INFO
+#include <rtdbg.h>
+
rt_inline rt_uint32_t timeout_calc(rt_hwtimer_t *timer, rt_hwtimerval_t *tv)
{
float overflow;
@@ -234,7 +237,8 @@ static rt_err_t rt_hwtimer_control(struct rt_device *dev, int cmd, void *args)
f = (rt_uint32_t*)args;
if ((*f > timer->info->maxfreq) || (*f < timer->info->minfreq))
{
- result = -RT_ERROR;
+ LOG_W("frequency setting out of range! It will maintain at %d Hz", timer->freq);
+ result = -RT_EINVAL;
break;
}