initial publsihed version, working. Tested on LPC1768 and Seed Arch BLE.

Dependencies:   AvailableMemory mbed

Fork of AvailableMemory_HelloWorld by Segundo Equipo

The purpose of this tiny application is to measure Flash and RAM allocation of mbed OS.

lightly extended from

main.cpp

Committer:
grassel
Date:
2014-11-27
Revision:
3:4d25cc6a3b98
Parent:
2:1ec7d87c70e3

File content as of revision 3:4d25cc6a3b98:

#include "mbed.h"
#include "AvailableMemory.h"

/*
  The purpose of this tiny application is to measure FLASh and RAM allocation 
  of mbed OS.
  
  lightly extended from 
  http://developer.mbed.org/users/segundo/code/AvailableMemory_HelloWorld/file/be64cf93dcba/main.cpp
  */

DigitalOut myled(LED1);

int main()
{
    myled = 1;
    printf("before heap alloc: available: %d Bytes\r\n", AvailableMemory(1));
    int *i = new int[500];
    i[0]=4711;
    i[499] = i[0];
    myled = !myled;
    printf("after 500*int heap alloc: available: %d Bytes\r\n", AvailableMemory(1));
}