Flute_Hello_World/src/flute_it.c

17 lines
442 B
C
Raw Permalink Normal View History

2021-04-11 17:27:48 +00:00
#include "flute_system.h"
#include "soc_peripherals.h"
__attribute__((interrupt)) void Default_IRQHandler(void) {
for(;;) {
//
}
2021-04-11 17:27:48 +00:00
}
__attribute__((interrupt)) void Timer_IRQHandler(void) {
SysTick++;
2021-04-11 17:27:48 +00:00
uint64_t *mtimecmp = (uint64_t *)(CLINT_BASE + 0x4000);
uint64_t *mtime = (uint64_t *)(CLINT_BASE + 0xBFF8);
*mtimecmp = *mtime + SYS_TICK_STEP; // Interrupt flag will be cleared by a write to MTIMECMP.
2021-04-11 17:27:48 +00:00
}