#include "uart.h" #include "svc_interface.h" void setup(void); void reset_handler(void) { static _Bool setup_done; if (!setup_done) setup(); setup_done = 1; // TODO do something here while(1); } void undefined_instruction_vector(void) { uart_puts("Undefined instruction occured"); while( 1 ) { /* Do Nothing! */ } } uint32_t supervisor_call_handler(enum svc_type request, uint32_t arg1, uint32_t arg2, uint32_t arg3) { (void) arg2; (void) arg3; // unused for now switch(request) { case UART_PUTCHAR: uart_putc(arg1); break; case UART_GETCHAR: return uart_getc(); case UART_WRITE: uart_puts("UART_WRITE not implemented!!!!!\n\r"); break; default: // perhaps we should kill the process now? uart_puts("unknown supervisor call type!!!!!\n\r"); } return 0; // a dummy value } void abort_handler(void) { uart_puts("re-entered system\n\r"); while(1); } void generic_handler(void) { uart_puts("something weird happened\n\r"); while(1); } void irq_handler(void) { uart_puts("irq happened\n\r"); while(1); } void fiq_handler(void) { uart_puts("fiq happened\n\r"); while(1); }