John Kemp / Mbed 2 deprecated memory_test

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Kemp
Date:
Tue Mar 29 13:42:16 2011 +0000
Child:
1:883b8bc1f54a
Commit message:

Changed in this revision

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Mar 29 13:42:16 2011 +0000
@@ -0,0 +1,38 @@
+#include "mbed.h"
+
+
+Serial pc(USBTX, USBRX);
+
+extern "C" void HardFault_Handler()
+{
+    pc.printf("Hard fault!\r\n");
+    exit(1);
+}
+
+
+void fail()
+{
+    pc.printf("Caught the failure\r\n");    
+    exit(1);
+}
+
+
+class Test
+{
+    public:
+        int something;
+        char woot[28];
+};
+
+
+int main() {
+    Test *dummy;
+    int index = 0;
+    
+    while(1) {
+        dummy = new Test;
+        if (dummy == NULL) fail();
+        pc.printf("%u\r\n", index);
+        ++index;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Mar 29 13:42:16 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912