]> wirehaze git hosting - stm32f411ceu6.git/blobdiff - sys/core/exceptions.c

wirehaze git hosting

panic ()
[stm32f411ceu6.git] / sys / core / exceptions.c
index 77e67d7fd2748e5984ad90ca2a3aba6f46d9ce7d..ad76fc9a3a16505c824ca7b3ade1de8092cacbc0 100644 (file)
@@ -2,6 +2,7 @@
 #include <link.h>
 #include <led.h>
 #include <uart.h>
 #include <link.h>
 #include <led.h>
 #include <uart.h>
+#include <panic.h>
 
 /* Initialize just enough to be able to handle a fault.  */
 __attribute__ ((noinline, used)) static void
 
 /* Initialize just enough to be able to handle a fault.  */
 __attribute__ ((noinline, used)) static void
@@ -46,8 +47,17 @@ reset_handler (void)
   asm ("b kentry");
 }
 
   asm ("b kentry");
 }
 
+/* TODO write proper exception handlers, this is just a test  */
+__attribute__ ((noreturn)) static void
+fault_handler (void)
+{
+  panic ("Fault");
+}
+
 __attribute__ ((section (".vector_table"), used))
 static unsigned long const vector_table[] = {
 __attribute__ ((section (".vector_table"), used))
 static unsigned long const vector_table[] = {
-  (unsigned long) &_sram_end,
-  (unsigned long) reset_handler,
+  [0] = (unsigned long) &_sram_end,
+  [1] = (unsigned long) reset_handler,
+  [3] = (unsigned long) fault_handler, /* ???  */
+  [6] = (unsigned long) fault_handler,
 };
 };