#include "xio.h" #include "xil_types.h" #include "xparameters.h" #include "mb_interface.h" #include "xil_exception.h" #include "xintc.h" unsigned X=0; void testHandler(void) __attribute__((fast_interrupt)); void testHandler(void) { X = 5 + 1; } int main(void) { XIntc XIntcSetStruct; XIntc_Initialize(&XIntcSetStruct, XPAR_MICROBLAZE_0_AXI_INTC_DEVICE_ID); XIntc_ConnectFastHandler(&XIntcSetStruct, 0, (XFastInterruptHandler)testHandler); XIntc_Start(&XIntcSetStruct, XIN_REAL_MODE); XIntc_Enable(&XIntcSetStruct, 0); Xil_ExceptionInit(); Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,(Xil_ExceptionHandler)XIntc_InterruptHandler,&XIntcSetStruct); Xil_ExceptionEnable(); return 0; }