Interrupt Service Routine for Pulpissimo
#1
Hi,
Are there any documents or codes available to write Interrupt Service Routine for Pulpissimo in C language?
Reply
#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
#3
Thank you meggiman...hope it helps
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)