From 153c109761001624747086abc161d2ee9ca0d611 Mon Sep 17 00:00:00 2001 From: Xiong Yu Date: Tue, 2 Oct 2018 14:57:51 +0800 Subject: [PATCH] bugfix(hw_timer): fix calculation overflow of timer less than 0x35A us error --- driver_lib/driver/hw_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver_lib/driver/hw_timer.c b/driver_lib/driver/hw_timer.c index 37383f00..256572ac 100644 --- a/driver_lib/driver/hw_timer.c +++ b/driver_lib/driver/hw_timer.c @@ -28,7 +28,7 @@ ((t) ? \ (((t) > 0x35A) ? \ (((t) >> 2) * ((APB_CLK_FREQ >> 4) / 250000) + ((t)&0x3) * ((APB_CLK_FREQ >> 4) / 1000000)) : \ - (((t) *(APB_CLK_FREQ>>4)) / 1000000)) : \ + ((t) *((APB_CLK_FREQ>>4) / 1000000))) : \ 0) #define FRC1_ENABLE_TIMER BIT7