aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-11-16 14:37:24 -0700
committerJosh Rahm <joshuarahm@gmail.com>2024-11-16 14:41:04 -0700
commit7b1008111baa95b4a8c3195f9f5a94bfdbe8d7d2 (patch)
tree75801992d44c8f96a2c09285ea3b5a869f70d90f /src
parent6bac8ebe38197babcc1d410e3f5f48792e83e400 (diff)
downloadch573-7b1008111baa95b4a8c3195f9f5a94bfdbe8d7d2.tar.gz
ch573-7b1008111baa95b4a8c3195f9f5a94bfdbe8d7d2.tar.bz2
ch573-7b1008111baa95b4a8c3195f9f5a94bfdbe8d7d2.zip
Move exc and nmi handlers to their own files.
Diffstat (limited to 'src')
-rw-r--r--src/main.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/main.c b/src/main.c
index c2796a9..ed82a3a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -185,32 +185,3 @@ void print_hex(uint32_t x)
++i;
}
}
-
-
-IRQ(exc)
-{
- uint32_t mcause, mepc, mtval, *sp;
-
- asm volatile("csrr %0, mcause" : "=r"(mcause));
- asm volatile("csrr %0, mepc" : "=r"(mepc));
- asm volatile("csrr %0, mtval" : "=r"(mtval));
-
- printf("Hardware Exception Caught:\n");
- printf(" mcause: 0x%80x\n", mcause);
- printf(" mepc: 0x%80x\n", mepc);
- printf(" mtval: 0x%80x\n", mtval);
-
- panic(mcause);
-
- while (1);
-}
-
-IRQ(nmi)
-{
- while (1) {
- GPIO_PORT.out.set(GPIO_PORT_A, ON, 8);
- delay();
- GPIO_PORT.out.set(GPIO_PORT_A, OFF, 8);
- delay();
- }
-}