diff options
| author | Bernard Xiong <[email protected]> | 2021-05-28 16:20:08 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-05-28 16:20:08 +0800 |
| commit | 92beddf3bccf6346e26aa097f82464456fb8e6bd (patch) | |
| tree | 197e4a108118dda016ea02274172f0c40e7ee8ed /components/drivers/cputime | |
| parent | b18a99b44240ec3152011e159cc24a5af8dff0ce (diff) | |
| parent | 03f4d40e30f3c94e1db0b3a65b3610dee695694a (diff) | |
Merge pull request #4737 from mysterywolf/3,1,xformatv3.1.5
[lts 3.1.x] format codes
Diffstat (limited to 'components/drivers/cputime')
| -rw-r--r-- | components/drivers/cputime/cputime.c | 10 | ||||
| -rw-r--r-- | components/drivers/cputime/cputime_cortexm.c | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/components/drivers/cputime/cputime.c b/components/drivers/cputime/cputime.c index 3ec860d5c5..4a9eee3a71 100644 --- a/components/drivers/cputime/cputime.c +++ b/components/drivers/cputime/cputime.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -14,7 +14,7 @@ static const struct rt_clock_cputime_ops *_cputime_ops = RT_NULL; /** - * The clock_cpu_getres() function shall return the resolution of CPU time, the + * The clock_cpu_getres() function shall return the resolution of CPU time, the * number of nanosecond per tick. * * @return the number of nanosecond per tick @@ -43,7 +43,7 @@ uint32_t clock_cpu_gettime(void) } /** - * The clock_cpu_microsecond() fucntion shall return the microsecond according to + * The clock_cpu_microsecond() fucntion shall return the microsecond according to * cpu_tick parameter. * * @param cpu_tick the cpu tick @@ -58,7 +58,7 @@ uint32_t clock_cpu_microsecond(uint32_t cpu_tick) } /** - * The clock_cpu_microsecond() fucntion shall return the millisecond according to + * The clock_cpu_microsecond() fucntion shall return the millisecond according to * cpu_tick parameter. * * @param cpu_tick the cpu tick @@ -74,7 +74,7 @@ uint32_t clock_cpu_millisecond(uint32_t cpu_tick) /** * The clock_cpu_seops() function shall set the ops of cpu time. - * + * * @return always return 0. */ int clock_cpu_setops(const struct rt_clock_cputime_ops *ops) diff --git a/components/drivers/cputime/cputime_cortexm.c b/components/drivers/cputime/cputime_cortexm.c index 05ed6ed447..071acfe9bb 100644 --- a/components/drivers/cputime/cputime_cortexm.c +++ b/components/drivers/cputime/cputime_cortexm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -19,7 +19,7 @@ static float cortexm_cputime_getres(void) { float ret = 1000 * 1000 * 1000; - + ret = ret / SystemCoreClock; return ret; } @@ -29,7 +29,7 @@ static uint32_t cortexm_cputime_gettime(void) return DWT->CYCCNT; } -const static struct rt_clock_cputime_ops _cortexm_ops = +const static struct rt_clock_cputime_ops _cortexm_ops = { cortexm_cputime_getres, cortexm_cputime_gettime @@ -38,13 +38,13 @@ const static struct rt_clock_cputime_ops _cortexm_ops = int cortexm_cputime_init(void) { /* check support bit */ - if ((DWT->CTRL & (1UL << DWT_CTRL_NOCYCCNT_Pos)) == 0) + if ((DWT->CTRL & (1UL << DWT_CTRL_NOCYCCNT_Pos)) == 0) { /* enable trace*/ CoreDebug->DEMCR |= (1UL << CoreDebug_DEMCR_TRCENA_Pos); - + /* whether cycle counter not enabled */ - if ((DWT->CTRL & (1UL << DWT_CTRL_CYCCNTENA_Pos)) == 0) + if ((DWT->CTRL & (1UL << DWT_CTRL_CYCCNTENA_Pos)) == 0) { /* enable cycle counter */ DWT->CTRL |= (1UL << DWT_CTRL_CYCCNTENA_Pos); |
