Guido Grassel / Mbed 2 deprecated Utility_AvailableMemory_blinky

Dependencies:   AvailableMemory mbed

Fork of AvailableMemory_HelloWorld by Segundo Equipo

Files at this revision

API Documentation at this revision

Comitter:
grassel
Date:
Thu Nov 27 17:21:09 2014 +0000
Parent:
1:be64cf93dcba
Child:
3:4d25cc6a3b98
Commit message:
initial checkin

Changed in this revision

AvailableMemory.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/AvailableMemory.lib	Sat Jun 11 16:53:13 2011 +0000
+++ b/AvailableMemory.lib	Thu Nov 27 17:21:09 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/segundo/code/AvailableMemory/#d00289c15c89
+http://mbed.org/users/segundo/code/AvailableMemory/#ea1fe2828f6f
--- a/main.cpp	Sat Jun 11 16:53:13 2011 +0000
+++ b/main.cpp	Thu Nov 27 17:21:09 2014 +0000
@@ -1,9 +1,23 @@
-#include <stdio.h>
+#include "mbed.h"
 #include "AvailableMemory.h"
 
-int main() {
+/*
+  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);
 
-    printf("Available memory (bytes to nearest 256) : %d\n", AvailableMemory());
-    printf("Available memory (exact bytes) : %d\n", AvailableMemory(1));
-
+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));
 }
\ No newline at end of file
--- a/mbed.bld	Sat Jun 11 16:53:13 2011 +0000
+++ b/mbed.bld	Thu Nov 27 17:21:09 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912
+http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5
\ No newline at end of file