diff options
| author | LaterComer <[email protected]> | 2024-05-30 12:04:33 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-05-30 12:04:33 +0800 |
| commit | 2cbe8bdae01cdd2d8fc0c55f363a94f13fb11a47 (patch) | |
| tree | ace26cd740059239a7abcc31345e88a7b7baa7fe /components/drivers/ktime/src/cputimer.c | |
| parent | 2fcf151a8e93806907081652a0389fb89aedd355 (diff) | |
解决ktime部分函数计算时unsigned long溢出 (#9008)
* 解决ktime部分函数计算时unsigned long溢出
* 恢复部分不需要ktime中部分rt_uint64_t类型的为unsigned long
Diffstat (limited to 'components/drivers/ktime/src/cputimer.c')
| -rw-r--r-- | components/drivers/ktime/src/cputimer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/drivers/ktime/src/cputimer.c b/components/drivers/ktime/src/cputimer.c index f182be894c..cbf96a815a 100644 --- a/components/drivers/ktime/src/cputimer.c +++ b/components/drivers/ktime/src/cputimer.c @@ -10,9 +10,9 @@ #include "ktime.h" -rt_weak unsigned long rt_ktime_cputimer_getres(void) +rt_weak rt_uint64_t rt_ktime_cputimer_getres(void) { - return ((1000UL * 1000 * 1000) * RT_KTIME_RESMUL) / RT_TICK_PER_SECOND; + return ((1000ULL * 1000 * 1000) * RT_KTIME_RESMUL) / RT_TICK_PER_SECOND; } rt_weak unsigned long rt_ktime_cputimer_getfrq(void) |
