Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

NiFpga_WaitOnIrqs()

Hi,

 

I have a question on this function,

NiFpga_Status NiFpga_WaitOnIrqs(NiFpga_Session session,
NiFpga_IrqContext context,
uint32_t irqs,
uint32_t timeout,
uint32_t* irqsAsserted,
NiFpga_Bool* timedOut);

 

What's the purpose of NiFpga_IrqContext context?

What if it is not initialized?

 

0 Kudos
Message 1 of 6
(180 Views)

From FPGA Interface C API Help. It is basically a reference to a specific interrupt.

ZYOng_0-1729596453280.png

IRQ contexts are single-threaded; only one thread can wait with a particular context at any given time.

To minimize jitter when first waiting on IRQs, reserve as many contexts as the application requires.

If a context is successfully reserved (the returned status is not an error), it must be unreserved later. Otherwise a memory leak will occur.

 

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 6
(152 Views)

If I only have one interrupt and one thread, can I set irqContext to 0?

0 Kudos
Message 3 of 6
(134 Views)

Based on the shipping examples at C:\Users\Public\Documents\National Instruments\FPGA Interface C API\Examples\IRQs, you don't have to assign anything to irqContext. It is a reference or "session" acquired dynamically.

 

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 4 of 6
(111 Views)

Do I need to reserve the irqContext if I do not use it?

0 Kudos
Message 5 of 6
(101 Views)

If you refer to the shipping example, you must reserve a context to call the WaitOnIrqs function.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 6 of 6
(94 Views)