I am trying to write a simple interrupt service routine for UART. MY code is as follows:
in main function:
static void receive_data(void* context)
// put new char into buffer from UART
volatile int *uart_capture_ptr = (volatile int*) context;
// Store the value in the Buttons edge capture register in *context.
*uart_capture_ptr = IORD_8DIRECT(UART_0_BASE, 0x0);
// Reset the Buttons edge capture register.
IOWR_16DIRECT(PIO_0_BASE, 0, (alt_16)uart_capture_ptr);
The program builds but seems to terminate upon the initialisation of the isr (i.e whilst executing the alt_ic_isr_register function). Does anyone know why this is the case and how I should fix it?
Please see an example of interrupt initialization and ISR service for PIO https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/nios2/n2sw_nii52006.pdf, pg8-16 & 8-17. To confirm where it fails, try to print out the return code of "alt_ic_isr_register".