Welcome to part three of “Interrupts: The Good, the Bad, and the Ugly”. We’ve already professed our love for interrupts, showing how they are useful for solving multiple common microcontroller tasks ...
// a scratch area per CPU for machine-mode timer interrupts. reg_t timer_scratch[NCPU][5]; #define interval 20000000 // cycles; about 2 second in qemu. void timer ...