GEX core repository.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gex-core/utils/stacksmon.h

43 lines
865 B

7 years ago
//
// Created by MightyPork on 2017/12/04.
//
// Utility for monitoring usage levels of FreeRTOS stacks and printing it in a nice table
//
7 years ago
#ifndef GEX_STACKSMON_H
#define GEX_STACKSMON_H
#include "platform.h"
#if USE_STACK_MONITOR
/** Number of tracked stacks, max */
#define STACK_NUM 4
/**
* Check canaries and trap if they're dead
*/
7 years ago
void stackmon_check_canaries(void);
/**
* Dump stacks usage table
*/
7 years ago
void stackmon_dump(void);
/**
* Register a stack to be monitored
*
* @param description - stack name
* @param buffer - stack buffer
* @param len - stack size in bytes
*/
7 years ago
void stackmon_register(const char *description, void *buffer, uint32_t len);
7 years ago
#else
#define stackmon_check_canaries() do {} while(0)
#define stackmon_dump() do {} while(0)
#define stackmon_register(description, buffer, len) do {} while(0)
#endif
#endif //GEX_STACKSMON_H