Zimin Wang / Mbed 2 deprecated DDRO_Farrari

Dependencies:   mbed-rtos mbed

Fork of DDRO_Farrari by Liangzhen Lai

Revision:
10:95e9932f7990
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/panic.cpp	Tue Feb 25 02:14:41 2014 +0000
@@ -0,0 +1,25 @@
+/*
+ * Written by Zimin Wang
+ *  
+ */
+#include "mbed.h"
+#include "pinout.h"
+#include "power.h"
+#include "panic.h"
+#include "basic_io.h"
+
+// When error happens, print error message, power down the core and terminate
+void panic(const char *format, ...)
+{
+    // print error message
+    va_list args;
+    va_start(args, format);
+    
+    mbed_vprintf(format, args);
+    va_end(args);
+    
+    wait(2);
+    power_down();
+    
+    exit(1);   
+}
\ No newline at end of file