summaryrefslogtreecommitdiffhomepage
path: root/ir/stat
diff options
context:
space:
mode:
authorAndreas Fried <andreas.fried@kit.edu>2017-07-21 11:29:03 +0200
committerAndreas Fried <andreas.fried@kit.edu>2017-07-21 12:30:40 +0200
commit1e70d2de40eaa5eb7fb2323117cbcdee2a0e05ba (patch)
treea22fb225b6d23cc7a06bcbe550e2284829d4c4ae /ir/stat
parent5e97a2dfb32463597f4698f89908d2285f24fe41 (diff)
stat_ev: Only enter/leave maximum priority if stat_ev is enabled.
Diffstat (limited to 'ir/stat')
-rw-r--r--ir/stat/statev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ir/stat/statev.c b/ir/stat/statev.c
index 9cb0288..cfbd8e1 100644
--- a/ir/stat/statev.c
+++ b/ir/stat/statev.c
@@ -72,7 +72,9 @@ void stat_ev_tim_push(void)
stat_ev_timer_elapsed[sp] = 0;
stat_ev_timer_start[sp] = temp;
if (sp == 0) {
- timing_enter_max_prio();
+ if (stat_ev_enabled) {
+ timing_enter_max_prio();
+ }
} else {
temp -= stat_ev_timer_start[sp-1];
stat_ev_timer_elapsed[sp-1] += temp;
@@ -90,7 +92,9 @@ void stat_ev_tim_pop(const char *name)
stat_ev_ull(name, stat_ev_timer_elapsed[sp]);
if (sp == 0) {
- timing_leave_max_prio();
+ if (stat_ev_enabled) {
+ timing_leave_max_prio();
+ }
} else {
stat_ev_timer_start[sp-1] = timing_ticks();
}