diff --git a/GorgonMeducer.perf_counter.pdsc b/GorgonMeducer.perf_counter.pdsc index ca9c3af..59b2809 100644 --- a/GorgonMeducer.perf_counter.pdsc +++ b/GorgonMeducer.perf_counter.pdsc @@ -16,8 +16,10 @@ https://github.com/GorgonMeducer/perf_counter.git - + - Improve delay accuracy + - Fix RT-Thread stack-fully-used issue + - introduce macro __PERF_COUNTER_CFG_USE_SYSTICK_WRAPPER__ - Add RT-Thread Package @@ -175,7 +177,7 @@ --> - + A dedicated performance counter for Cortex-M systick. documents/Doxygen/html/index.html @@ -188,6 +190,7 @@ #define __PERF_COUNTER__ +#define __PERF_COUNTER_CFG_USE_SYSTICK_WRAPPER__ @@ -202,6 +205,7 @@ #define __PERF_COUNTER__ +#define __PERF_COUNTER_CFG_USE_SYSTICK_WRAPPER__ diff --git a/README.md b/README.md index 3e1b87b..b3c0735 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# perf_counter (v1.9.8-dev) +# perf_counter (v1.9.8) A dedicated performance counter for Cortex-M Systick. It shares the SysTick with users' original SysTick function(s) without interfering with it. This library will bring new functionalities, such as performance counter,` delay_us` and `clock()` service defined in `time.h`. ### Features: @@ -203,14 +203,6 @@ void SysTick_Handler(void) ... } ``` -Implement an empty funciton `__ensure_systick_wrapper()` as there is no wrapper actually used in this deployment method: - -```c -void __ensure_systick_wrapper(void) -{ -} -``` - 7. Make sure the `SystemCoreClock` is updated with the same value as CPU frequency. diff --git a/perf_counter.c b/perf_counter.c index b1310ec..d90c514 100644 --- a/perf_counter.c +++ b/perf_counter.c @@ -236,12 +236,14 @@ void init_cycle_counter(bool bIsSysTickOccupied) s_lSystemClockCounts = 0; // reset system cycle counter s_nSystemMS = 0; // reset system millisecond counter +#if defined(__PERF_COUNTER_CFG_USE_SYSTICK_WRAPPER__) #if defined(__IS_COMPILER_ARM_COMPILER_5__) \ || defined(__IS_COMPILER_ARM_COMPILER_6__) \ || defined(__IS_COMPILER_GCC__) \ || defined(__IS_COMPILER_LLVM__) extern void __ensure_systick_wrapper(void); __ensure_systick_wrapper(); +#endif #endif __perf_os_patch_init();