diff --git a/GorgonMeducer.perf_counter.pdsc b/GorgonMeducer.perf_counter.pdsc index 4b4f081..9078a81 100644 --- a/GorgonMeducer.perf_counter.pdsc +++ b/GorgonMeducer.perf_counter.pdsc @@ -1,6 +1,6 @@ - + GorgonMeducer perf_counter A dedicated performance counter for the Cortex-M Systick. It shares the SysTick with users' original SysTick function without interfering with it. This library will bring new functionalities, such as performance counter, delay_us and clock() service defined in time.h diff --git a/cmsis-pack/GorgonMeducer.perf_counter.2.1.0.pack b/cmsis-pack/GorgonMeducer.perf_counter.2.1.0.pack index 7e3ca25..4be1d85 100644 Binary files a/cmsis-pack/GorgonMeducer.perf_counter.2.1.0.pack and b/cmsis-pack/GorgonMeducer.perf_counter.2.1.0.pack differ diff --git a/cmsis-pack/GorgonMeducer.perf_counter.pdsc b/cmsis-pack/GorgonMeducer.perf_counter.pdsc index 4b4f081..9078a81 100644 --- a/cmsis-pack/GorgonMeducer.perf_counter.pdsc +++ b/cmsis-pack/GorgonMeducer.perf_counter.pdsc @@ -1,6 +1,6 @@ - + GorgonMeducer perf_counter A dedicated performance counter for the Cortex-M Systick. It shares the SysTick with users' original SysTick function without interfering with it. This library will bring new functionalities, such as performance counter, delay_us and clock() service defined in time.h diff --git a/gen_pack.sh b/gen_pack.sh index 2ec793c..28b2e3d 100644 --- a/gen_pack.sh +++ b/gen_pack.sh @@ -22,7 +22,7 @@ if [ `uname -s` = "Linux" ] PATH_TO_ADD="$CMSIS_PACK_PATH/CMSIS/Utilities/Linux64/" else CMSIS_PACK_PATH="/C/Users/gabriel/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0" - PATH_TO_ADD="/C/Program Files (x86)/7-Zip/:$CMSIS_PACK_PATH/CMSIS/Utilities/Win32/:/C/xmllint/" + PATH_TO_ADD="/C/Program Files/7-Zip/:$CMSIS_PACK_PATH/CMSIS/Utilities/Win32/:/C/xmllint/" fi [[ ":$PATH:" != *":$PATH_TO_ADD}:"* ]] && PATH="${PATH}:${PATH_TO_ADD}" echo $PATH_TO_ADD appended to PATH diff --git a/lib/perf_os_patch_rt_thread.c b/lib/perf_os_patch_rt_thread.c index dce2134..67d7098 100644 --- a/lib/perf_os_patch_rt_thread.c +++ b/lib/perf_os_patch_rt_thread.c @@ -80,10 +80,12 @@ task_cycle_info_t * get_rtos_task_cycle_info(void) void __perf_os_patch_init(void) { -#ifdef PKG_USING_PERF_COUNTER +#ifdef PKG_PERF_COUNTER_USING_THREAD_STATISTIC 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 @@ -91,6 +93,7 @@ void __ensure_systick_wrapper(void) { } +#ifdef PKG_PERF_COUNTER_USING_THREAD_STATISTIC #define DBG_TAG "perf_counter" #define DBG_LVL DBG_INFO #include @@ -103,4 +106,5 @@ static int _perf_counter_init(void) return 0; } INIT_PREV_EXPORT(_perf_counter_init); +#endif /* PKG_PERF_COUNTER_USING_THREAD_STATISTIC */ #endif /* PKG_USING_PERF_COUNTER */