Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: AvailableMemory mbed
Fork of AvailableMemory_HelloWorld by
Revision 2:1ec7d87c70e3, committed 2014-11-27
- 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
--- 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
