[rtems commit] leon, ckinit: avoid assuming 1MHz timer pre-scaler clock
Daniel Hellstrom
danielh at rtems.org
Sun Mar 7 15:56:14 UTC 2021
Module: rtems
Branch: 5
Commit: 81e4a15b188a8d3aff526fc39ca6f09ac85d27bb
Changeset: http://git.rtems.org/rtems/commit/?id=81e4a15b188a8d3aff526fc39ca6f09ac85d27bb
Author: Daniel Hellstrom <daniel at gaisler.com>
Date: Fri Apr 12 12:20:07 2019 +0200
leon,ckinit: avoid assuming 1MHz timer pre-scaler clock
Update #4310.
---
bsps/shared/grlib/btimer/tlib_ckinit.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/bsps/shared/grlib/btimer/tlib_ckinit.c b/bsps/shared/grlib/btimer/tlib_ckinit.c
index 4f67998..5ac3250 100644
--- a/bsps/shared/grlib/btimer/tlib_ckinit.c
+++ b/bsps/shared/grlib/btimer/tlib_ckinit.c
@@ -209,15 +209,14 @@ static uint32_t simple_tlib_tc_get_timecount(struct timecounter *tc)
static rtems_device_driver simple_initialize_counter(void)
{
- uint64_t frequency;
- unsigned int tick_hz;
+ unsigned int tick_hz, frequency;
- frequency = 1000000;
+ tlib_get_freq(priv.tlib_tick, &frequency, NULL);
tick_hz = rtems_configuration_get_microseconds_per_tick();
rtems_timecounter_simple_install(
&priv.tc_simple,
- frequency,
+ (uint64_t)frequency,
tick_hz,
simple_tlib_tc_get_timecount
);
More information about the vc
mailing list