module ti.mcu.msp430.runtime.utils.Stack |
|
|
Stack monitoring functions
This module provides simple stack monitoring operations that enables an
application efficiently monitor the system's worst-case stack usage.
[
more ... ]
#include <ti/mcu/msp430/runtime/utils/Stack.h>
Functions |
Bool | |
Void | |
Void | |
Int | |
Functions common to all target modules |
|
|
Typedefs |
typedef struct | |
Constants |
| |
DETAILS
This module provides simple stack monitoring operations that enables an
application efficiently monitor the system's worst-case stack usage.
Stack overruns are a common problem in embedded development and they
result in intermittent and difficult to reproduce failures. The ability
to quickly determine of unexpected behavious is the result of a stack
overrun can save hours of debug time.
struct Stack_Status |
|
Stack status information buffer
typedef struct Stack_Status {
Int unused;
// number of words never used (so far)
Int used;
// worst-case number of words used (so far)
Int curDepth;
// current number of words on the stack
} Stack_Status;
config Stack_UNUSED // module-wide |
|
Unused stack space event
Stack_check() // module-wide |
|
Return non-zero if stack pointer is within allocated stack
DETAILS
If this function returns 0, the current stack pointer is pointing
to a location _outside_ the caller's allocated stack.
Stack_fill() // module-wide |
|
Fill unused stack with initial value
DETAILS
This function is called at startup and may be called at runtime
to re-initialize the stack. However, interrupts must be disabled
during this process (to prevent corruption of ISR state).
Stack_getStatus() // module-wide |
|
Get number of words of unused stack space
Stack_getUnused() // module-wide |
|
Get number of words of unused stack space
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool Stack_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool Stack_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 Stack_Module_getMask();
// Returns the diagnostics mask for this module
Void Stack_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
var Stack = xdc.useModule('ti.mcu.msp430.runtime.utils.Stack');
module-wide constants & types
module-wide config parameters
msg: "unused stack space = %d words"
};
generated on Thu, 27 Sep 2012 23:22:30 GMT