10-21-2024 01:14 AM
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?
10-22-2024 06:28 AM
From FPGA Interface C API Help. It is basically a reference to a specific interrupt.
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.
10-22-2024 08:51 PM
If I only have one interrupt and one thread, can I set irqContext to 0?
10-24-2024 07:50 PM
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.
10-24-2024 09:11 PM
Do I need to reserve the irqContext if I do not use it?
10-24-2024 10:00 PM
If you refer to the shipping example, you must reserve a context to call the WaitOnIrqs function.