Interrupt Service Routine for Pulpissimo
#2
Hi RiscV,

I don't know of any documents but here is a C snippet that illustrates how to do it with the pulp-runtime (https://github.com/pulp-platform/pulp-runtime):

#include "pulp.h"

void handle_soc_event_interrupts(void ) __attribute((interrupt));
void handle_soc_event_interrupts(void) {
  // normal C code here. Do something useful, call other functions etc.
}

int main() {
   // some other initialization
   
  // Set interrupt handle for SoC events (IRQ 26)
  rt_irq_set_handler(26, handle_soc_event_interrupts);
  // Enable soc_event interrupts (IRQ 26)
  hal_itc_enable_set(1<<26);

  while (1)
           hal_itc_wait_for_interrupt(); // Calls _WFI instruction and stalls the core until an interrupt arrives

}
Reply


Messages In This Thread
RE: Interrupt Service Routine for Pulpissimo - by meggiman - 02-23-2021, 08:56 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)