Interrupt Service Routine for Pulpissimo
Are there any documents or codes available to write Interrupt Service Routine for Pulpissimo in C language?
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 (

#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)

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

Thank you meggiman...hope it helps

Forum Jump:

Users browsing this thread: 1 Guest(s)