Function to calculate the memory available for malloc
Dependents: AvailableMemory_HelloWorld MCBBThermostat helloaabbc SP14P1_skeleton
Diff: AvailableMemory.h
- Revision:
- 10:7474d5df69c2
- Parent:
- 9:caba868a4c1a
- Child:
- 11:0f5d5918761a
--- a/AvailableMemory.h Sun Nov 07 21:39:16 2010 +0000 +++ b/AvailableMemory.h Sun Nov 07 21:52:34 2010 +0000 @@ -1,5 +1,7 @@ -/** \file - * Return the available memory for a malloc call +/** @file + * Return the memory available for a malloc call + * This is done by a binary search approach + * calling malloc/free starting with a maximum */ #ifndef SEGUNDO_UTILITIES_AVAILABLEMEMORY_H #define SEGUNDO_UTILITIES_AVAILABLEMEMORY_H @@ -13,14 +15,18 @@ */ namespace Utilities { -/** Return the available memory for a malloc call +/** Return the memory available for a malloc call + * @return AvailableMemory(256, 0x8000, true) */ int AvailableMemory(); -/** Return the available memory for a malloc call - * \param resolution Resolution in number of bytes - * \param maximum Maximum amount of memory to check - * \param disableInterrupts Disable interrupts whilst checking +/** Return the memory available for a malloc call + * @param resolution Resolution in number of bytes + * 1 will return the exact value + * 256 will return the available memory to the nearest 256 bytes + * @param maximum Maximum amount of memory to check + * @param disableInterrupts Disable interrupts whilst checking + * @return Available memory in bytes */ int AvailableMemory(int resolution, int maximum, bool disableInterrupts);