GxFpgaDiscardEvents

Purpose

Clears the event queue.

Syntax

GxFpgaDiscardEvents (nHandle, nEventType, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX3700 board.

nEventType

SHORT

Event type. Use the constant GT_EVENT_INTERRUPT (1). No other value is supported.

pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function clears the event queue and remove all pending events. Setting an event handler using the GxFpgaSetEvent automatically clears the event queue.

Example

The following example uses discard events to reset the queue after lengthy operation:

 

GxFpgaInitialize (1, &nHandle, &nStatus);

GxFpgaSetEvent(nHandle, GT_EVENT_INTERRUPT, TRUE, NULL, (PVOID)1, &nStatus);

while (TRUE)

{

    ! wait up to 1000 ms for the event

    GxFpgaWaitOnEvent(nHandle, GT_EVENT_INTERRUPT, 1000, &nStatus);

    if (nStatus!=0) ! success event occurred

    {    printf(“no event occurred - exiting”);

         break;       

    }

    else

    {   ! do something lengthy …

        ! now ready to receive more events

        GxFpgaDiscardEvents(nHandle, GT_EVENT_INTERRUPT, &nStatus);

 

See Also

GxFpgaInitialize, GxFpgaGetErrorString, GxFpgaWaitOnEvent, GxFpgaSetEvent