Use a target timer to signal a semaphore when a target time is reached.
HPESTATUS hpeSetTargetTimer( HPEHANDLE devhandle, DWORD idx, HPE_1588_TIMESTAMP *time, QWORD ns_delta, KNHANDLE sem );
devhandle
idx
time
ns_delta
hep1588GetSystemTime
with some delta added with hpe1588TimeAdd
. May be NULL if sem is NULL, in which case the timer is canceled.
sem
Small values of us_delta (< 50us) may result in heavy CPU load (depending on the CPU and other system factors). If “time” is less than the actual system time, the semaphore is never signaled. Canceling a timer may leave outstanding units on a semaphore if they have not been consumed by the application. If the system time is adjusted (by way of hpe1588SetSystemTime
, hpe1588AdjustSystemTime
) timers may be extended or missed. If a periodic timer is required it may be advantageous to use a “one shot” timer (us_delta = 0). This will allow the application to compensate for propagation delay incurred when configuring the timer.
A status value indicating the success or failure of the operation:
E_OK |
The operation completed successfully. |
E_EXIST |
The handle given is not a handle for an open HPE interface. |
E_LIMIT |
The value of the idx parameter is out of range. |
E_PARAM |
The time parameter is NULL and the semd parameter is non-NULL. |
E_CONTEXT |
The device has not been opened in ALL_INTERRUPTS mode. |
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 6.0 (HPE3) | intime/rt/include/hpeif2.h | hpeif2.h | hpeif2.lib |