From 4ff92be23b72154ceeff666d290572f80437c898 Mon Sep 17 00:00:00 2001 From: Bernd Herzog Date: Mon, 24 Apr 2023 13:04:59 +0200 Subject: [PATCH] refactoring --- firmware/baseband/debug.cpp | 7 ++----- firmware/common/performance_counter.hpp | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/firmware/baseband/debug.cpp b/firmware/baseband/debug.cpp index 032d0042..58548e7a 100644 --- a/firmware/baseband/debug.cpp +++ b/firmware/baseband/debug.cpp @@ -126,12 +126,9 @@ void update_performance_counters() { if ((((chTimeNow()>>10) & 0x01) == 0x01) == last_paint_state) return; - volatile auto idle_thread = chSysGetIdleThread(); - if (chThdGetTicks(idle_thread) > 0x10000000) { + // Idle thread state is sometimes unuseable + if (chThdGetTicks(chSysGetIdleThread()) > 0x10000000) return; - } - - idle_thread = nullptr; last_paint_state = !last_paint_state; diff --git a/firmware/common/performance_counter.hpp b/firmware/common/performance_counter.hpp index 4b9b43cb..ee3655ad 100644 --- a/firmware/common/performance_counter.hpp +++ b/firmware/common/performance_counter.hpp @@ -26,4 +26,4 @@ uint8_t get_cpu_utilisation_in_percent(); -#endif /* __PERFORMANCE_COUNTER_H__ */ \ No newline at end of file +#endif /* __PERFORMANCE_COUNTER_H__ */