Function to calculate the memory available for malloc

Dependents:   AvailableMemory_HelloWorld MCBBThermostat helloaabbc SP14P1_skeleton

AvailableMemory.h

Committer:
segundo
Date:
2010-11-07
Revision:
6:e94f3a11bad7
Parent:
5:45826003052b
Child:
7:b4a90cb19332

File content as of revision 6:e94f3a11bad7:

/** \file
 * Return the available memory for a malloc call
 */
#ifndef SEGUNDO_UTILITIES_AVAILABLEMEMORY_H
#define SEGUNDO_UTILITIES_AVAILABLEMEMORY_H

/** @fn const char *Test::member(char c,int n)
 *  @brief A member function.
 *  @param c a character.
 *  @param n an integer.
 *  @exception std::out_of_range parameter is out of range.
 *  @return a character pointer.
 */

///Ethernet network interface return codes
enum EthernetErr {
    __ETH_MIN = -0xFFFF,
    ETH_TIMEOUT, ///<Timeout during setup
    ETH_OK = 0 ///<Success
};

namespace segundo {
namespace Utilities {

/** Return the available memory for a malloc call (to the nearest 256 bytes)
 */
int AvailableMemory();

/** Return the available memory for a malloc call
 *
 * @param resolution A normalised number 0.0-1.0 to represent the full range.
 * @param maximum A normalised number 0.0-1.0 to represent the full range.
 * @param disableInterrupts A normalised number 0.0-1.0 to represent the full range.
 */
int AvailableMemory(int resolution, int maximum, bool disableInterrupts);

} // namespace Utilities
} // namespace segundo

using namespace segundo::Utilities;

#endif // SEGUNDO_UTILITIES_AVAILABLEMEMORY_H