summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/debug_menu.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index c4bec5a487..d9d1e85d11 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -88,8 +88,10 @@ bool dbg_os(void)
88 char buf[32]; 88 char buf[32];
89 int i; 89 int i;
90 int usage; 90 int usage;
91#if NUM_CORES > 1
91 unsigned int core; 92 unsigned int core;
92 int line; 93 int line;
94#endif
93 95
94 lcd_setmargins(0, 0); 96 lcd_setmargins(0, 0);
95 lcd_setfont(FONT_SYSFIXED); 97 lcd_setfont(FONT_SYSFIXED);
@@ -97,6 +99,7 @@ bool dbg_os(void)
97 99
98 while(1) 100 while(1)
99 { 101 {
102#if NUM_CORES > 1
100 lcd_puts(0, 0, "Core and stack usage:"); 103 lcd_puts(0, 0, "Core and stack usage:");
101 line = 0; 104 line = 0;
102 for(core = 0; core < NUM_CORES; core++) 105 for(core = 0; core < NUM_CORES; core++)
@@ -108,6 +111,15 @@ bool dbg_os(void)
108 lcd_puts(0, ++line, buf); 111 lcd_puts(0, ++line, buf);
109 } 112 }
110 } 113 }
114#else
115 lcd_puts(0, 0, "Stack usage:");
116 for(i = 0; i < num_threads[CURRENT_CORE];i++)
117 {
118 usage = thread_stack_usage(i);
119 snprintf(buf, 32, "%s: %d%%", thread_name[CURRENT_CORE][i], usage);
120 lcd_puts(0, 1+i, buf);
121 }
122#endif
111 123
112 lcd_update(); 124 lcd_update();
113 125