[rtems commit] rtems: Use rtems_clock_get_ticks_per_second()
Sebastian Huber
sebh at rtems.org
Wed May 12 04:41:23 UTC 2021
Module: rtems
Branch: master
Commit: e3bec23d4d11866e6632a4c975defaa30fd2bd0e
Changeset: http://git.rtems.org/rtems/commit/?id=e3bec23d4d11866e6632a4c975defaa30fd2bd0e
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue May 11 17:19:31 2021 +0200
rtems: Use rtems_clock_get_ticks_per_second()
This avoids an integer division at runtime.
---
cpukit/rtems/src/clocktodvalidate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cpukit/rtems/src/clocktodvalidate.c b/cpukit/rtems/src/clocktodvalidate.c
index d8e9d01..95c8e77 100644
--- a/cpukit/rtems/src/clocktodvalidate.c
+++ b/cpukit/rtems/src/clocktodvalidate.c
@@ -46,8 +46,8 @@ rtems_status_code _TOD_Validate(
return RTEMS_INVALID_ADDRESS;
}
- ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
- rtems_configuration_get_microseconds_per_tick();
+ ticks_per_second = rtems_clock_get_ticks_per_second();
+
if ((the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
More information about the vc
mailing list