Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
GorgonMeducer committed Apr 9, 2024
1 parent f67b659 commit e22be68
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e22be68

Please sign in to comment.