Skip to content

Commit

Permalink
Merge pull request #32 from DinoHaw/addRtthreadNanoSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
GorgonMeducer authored Sep 19, 2023
2 parents 5660b13 + 683e909 commit b0f305b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/perf_os_patch_rt_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,22 @@ task_cycle_info_t * get_rtos_task_cycle_info(void)

void __perf_os_patch_init(void)
{
#if defined(RTTHREAD_VERSION) && (RTTHREAD_VERSION >= (4 * 10000))
rt_tick_sethook(user_code_insert_to_systick_handler);
#endif

#if !defined(PKG_USING_PERF_COUNTER) || (defined(PKG_PERF_COUNTER_USING_THREAD_STATISTIC))
rt_scheduler_sethook(__rt_thread_scheduler_hook);
#endif
}

#ifdef PKG_USING_PERF_COUNTER

#if defined(RTTHREAD_VERSION) && (RTTHREAD_VERSION >= (4 * 10000))
void __ensure_systick_wrapper(void)
{
}
#endif

#define DBG_TAG "perf_counter"
#define DBG_LVL DBG_INFO
Expand Down
5 changes: 5 additions & 0 deletions os/perf_os_patch_rt_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,22 @@ task_cycle_info_t * get_rtos_task_cycle_info(void)

void __perf_os_patch_init(void)
{
#if defined(RTTHREAD_VERSION) && (RTTHREAD_VERSION >= (4 * 10000))
rt_tick_sethook(user_code_insert_to_systick_handler);
#endif

#if !defined(PKG_USING_PERF_COUNTER) || (defined(PKG_PERF_COUNTER_USING_THREAD_STATISTIC))
rt_scheduler_sethook(__rt_thread_scheduler_hook);
#endif
}

#ifdef PKG_USING_PERF_COUNTER

#if defined(RTTHREAD_VERSION) && (RTTHREAD_VERSION >= (4 * 10000))
void __ensure_systick_wrapper(void)
{
}
#endif

#define DBG_TAG "perf_counter"
#define DBG_LVL DBG_INFO
Expand Down

0 comments on commit b0f305b

Please sign in to comment.