diff --git a/example/example.uvoptx b/example/example.uvoptx
index 75e7724..310ac4b 100644
--- a/example/example.uvoptx
+++ b/example/example.uvoptx
@@ -75,7 +75,7 @@
1
0
- 0
+ 1
7
@@ -297,7 +297,7 @@
1
0
- 1
+ 0
7
diff --git a/example/main.c b/example/main.c
index 796f32c..11a7cd9 100644
--- a/example/main.c
+++ b/example/main.c
@@ -195,9 +195,9 @@ int main (void)
}
__cpu_time__(10) {
- delay_us(3000);
+ delay_us(30000);
}
- delay_us(7000);
+ delay_us(70000);
}
}
diff --git a/lib/libperf_counter_gcc.a b/lib/libperf_counter_gcc.a
index b34c187..ad82e39 100644
Binary files a/lib/libperf_counter_gcc.a and b/lib/libperf_counter_gcc.a differ
diff --git a/lib/perf_counter.h b/lib/perf_counter.h
index e91c8d1..f1a527f 100644
--- a/lib/perf_counter.h
+++ b/lib/perf_counter.h
@@ -357,9 +357,9 @@ __asm(".global __ensure_systick_wrapper\n\t");
#define __cpu_time__(__CNT, ...) \
static int64_t SAFE_NAME(s_lTimestamp) = 0, SAFE_NAME(s_lTotal) = 0; \
static uint32_t s_wLoopCounter = (__CNT); \
- using(int64_t lStart = 0, ({ \
+ using(float __usage__ = 0, ({ \
if (0 == s_wLoopCounter) { \
- float __usage__ = (float)((double)SAFE_NAME(s_lTotal) \
+ __usage__ = (float)((double)SAFE_NAME(s_lTotal) \
/ (double)( get_system_ticks() \
- SAFE_NAME(s_lTimestamp))); \
__usage__ *= 100.0f; \
@@ -375,8 +375,8 @@ __asm(".global __ensure_systick_wrapper\n\t");
SAFE_NAME(s_lTimestamp) = get_system_ticks(); \
s_wLoopCounter = (__CNT); \
} \
- lStart = get_system_ticks();}), \
- ({SAFE_NAME(s_lTotal) += get_system_ticks() - lStart; \
+ start_task_cycle_counter();}), \
+ ({SAFE_NAME(s_lTotal) += stop_task_cycle_counter(); \
s_wLoopCounter--;}))
/*!
diff --git a/lib/perf_counter.lib b/lib/perf_counter.lib
index 38ca63a..5f2ca4d 100644
Binary files a/lib/perf_counter.lib and b/lib/perf_counter.lib differ
diff --git a/perf_counter.h b/perf_counter.h
index e91c8d1..f1a527f 100644
--- a/perf_counter.h
+++ b/perf_counter.h
@@ -357,9 +357,9 @@ __asm(".global __ensure_systick_wrapper\n\t");
#define __cpu_time__(__CNT, ...) \
static int64_t SAFE_NAME(s_lTimestamp) = 0, SAFE_NAME(s_lTotal) = 0; \
static uint32_t s_wLoopCounter = (__CNT); \
- using(int64_t lStart = 0, ({ \
+ using(float __usage__ = 0, ({ \
if (0 == s_wLoopCounter) { \
- float __usage__ = (float)((double)SAFE_NAME(s_lTotal) \
+ __usage__ = (float)((double)SAFE_NAME(s_lTotal) \
/ (double)( get_system_ticks() \
- SAFE_NAME(s_lTimestamp))); \
__usage__ *= 100.0f; \
@@ -375,8 +375,8 @@ __asm(".global __ensure_systick_wrapper\n\t");
SAFE_NAME(s_lTimestamp) = get_system_ticks(); \
s_wLoopCounter = (__CNT); \
} \
- lStart = get_system_ticks();}), \
- ({SAFE_NAME(s_lTotal) += get_system_ticks() - lStart; \
+ start_task_cycle_counter();}), \
+ ({SAFE_NAME(s_lTotal) += stop_task_cycle_counter(); \
s_wLoopCounter--;}))
/*!