Flute_Hello_World/src/flute_it.c

22 lines
487 B
C

#include "flute_system.h"
#include "soc_peripherals.h"
void Timer_IRQHandler(void) {
SysTick++;
*(uint64_t *)(CLINT_BASE + 0x4000) = SYS_TICK_STEP;
*(uint64_t *)(CLINT_BASE + 0xBFF8) = 0ULL;
}
__attribute__((interrupt)) void Exception_Handler(void) {
uint64_t mcause = 0;
__csrr("mcause", mcause);
switch(mcause) {
case 0x8000000000000007: // MTIME
Timer_IRQHandler();
break;
default:
for(;;) {}
}
}