John Kemp
/
memory_test
Demonstrates crash on memory allocation.
Diff: main.cpp
- Revision:
- 1:883b8bc1f54a
- Parent:
- 0:786b75c6aaca
--- a/main.cpp Tue Mar 29 13:42:16 2011 +0000 +++ b/main.cpp Tue Mar 29 13:47:01 2011 +0000 @@ -2,18 +2,29 @@ Serial pc(USBTX, USBRX); +BusOut leds(LED1, LED2, LED3, LED4); extern "C" void HardFault_Handler() { pc.printf("Hard fault!\r\n"); - exit(1); + while(1) { + leds = 0x09; + wait(0.4); + leds = 0x06; + wait(0.4); + } } void fail() { pc.printf("Caught the failure\r\n"); - exit(1); + while(1) { + leds = 0x09; + wait(0.4); + leds = 0x06; + wait(0.4); + } }