From e22be687f69d0b5dab119f5e32d75a8cdf9c45ce Mon Sep 17 00:00:00 2001 From: Gabriel Wang Date: Tue, 9 Apr 2024 20:48:59 +0100 Subject: [PATCH] minor update --- perf_counter.c | 8 +++++++- perf_counter.h | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/perf_counter.c b/perf_counter.c index 5230d04..b74fb0f 100644 --- a/perf_counter.c +++ b/perf_counter.c @@ -127,6 +127,11 @@ void perfc_port_insert_to_system_timer_insert_ovf_handler(void) } +uint32_t perfc_get_systimer_frequency(void) +{ + return perfc_port_get_system_timer_freq(); +} + __WEAK void __perf_os_patch_init(void) { @@ -157,7 +162,8 @@ bool init_cycle_counter(bool bIsSysTickOccupied) s_lSystemClockCounts = 0; // reset system cycle counter s_lSystemMS = 0; // reset system millisecond counter s_lSystemUS = 0; // reset system microsecond counter - + s_lOldTimestamp = 0; + __perf_os_patch_init(); return bResult; diff --git a/perf_counter.h b/perf_counter.h index a38b843..56e6ab4 100644 --- a/perf_counter.h +++ b/perf_counter.h @@ -669,6 +669,12 @@ int64_t stop_cycle_counter(void) * @{ */ +/*! + * \brief get the system timer frequency + * \return uint32_t the system timer frequency in Hz + */ +extern uint32_t perfc_get_systimer_frequency(void); + /*! * \brief get the elapsed milliseconds since perf_counter is initialised * \return int64_t the elapsed milliseconds