Skip to content

Commit 8070468

Browse files
committed
GREENTEA - Fix warning about unused function in greentea_metrics.cpp.
This change isolate properly functions and variable declared when MBED_STACK_STATS_ENABLED is on.
1 parent 90496ed commit 8070468

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

features/frameworks/greentea-client/source/greentea_metrics.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ typedef struct {
3535

3636
// Mutex to protect "buf"
3737
SingletonPtr<Mutex> mutex;
38+
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
3839
static char buf[128];
3940
static SingletonPtr<CircularBuffer<thread_info_t, THREAD_BUF_COUNT> > queue;
41+
#endif
4042

4143
static void send_heap_info(void);
44+
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
4245
static void send_stack_info(void);
4346
static void on_thread_terminate(osThreadId id);
4447
static void enqeue_thread_info(osThreadId id);
@@ -47,6 +50,7 @@ static void deque_and_print_thread_info(void);
4750
// sprintf uses a lot of stack so use these instead
4851
static uint32_t print_hex(char *buf, uint32_t value);
4952
static uint32_t print_dec(char *buf, uint32_t value);
53+
#endif
5054

5155
void greentea_metrics_setup()
5256
{
@@ -71,6 +75,7 @@ static void send_heap_info()
7175
greentea_send_kv("max_heap_usage",heap_stats.max_size);
7276
}
7377

78+
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
7479
MBED_UNUSED static void send_stack_info()
7580
{
7681
mutex->lock();
@@ -205,3 +210,5 @@ static uint32_t print_dec(char *buf, uint32_t value)
205210

206211
return pos;
207212
}
213+
214+
#endif

0 commit comments

Comments
 (0)