APX-3302 User's Manual (OM110000019A)
-89 -
■
Cancel standby (abort)
In AcapWaitEvent, process does not return until it receives interrupt or timeout occurs.
When AcapSetEvent is performed by using ACL_INT_ABORT flag from other thread, standby process of
AcapWaitEvent can be abort.
■
The setting example for software
The sample code to abort the thread (Thread_WaitFrameEnd) that is waiting to be notified under
ACL_INT_FRAMEEND is as follows.
<Sample code>
■
Cancellation
You need to cancel setting if setting event is unnecessary to stand by.
Perform AcapSetEvent, which 4
th
argument “bEventEnable” is set as FALSE, for cancel setting.
■
The setting example for software
The sample code to cancel event setting is as follows.
<Sample code>
When AcapWaitEvent is under performing (under standby state), it becomes error since cannot cancel that.
In this case, cancels
after execute “cancel standby”.
// Specify ACL_INT_ABORT and the event that will be aborted
rtn = AcapSetEvent(hDevice, channel, ACL_INT_FRAMEEND | ACL_INT_ABORT, TRUE);
//Thread which waits to be notified "1 frame input completion interrupt"
void
Thread_WaitEvent(
void
* pParam)
{
// Omit here
// Wait to be notified "1 frame input completion interrupt"
int
FrameEndTimeout_ms = 10 * 1000;
rtn = AcapWaitEvent(hDevice, channel, ACL_INT_FRAMEEND, FrameEndTimeout_ms);
if
(rtn == ACL_RTN_ERROR){
ACAPERRORINFO AcapErrInfo;
AcapGetLastErrorCode(&AcapErrInfo, 0);
if
(AcapErrInfo.dwBoardErrorCode==ACL_ABORT_EVENT_WAIT){
// Function is returned as error if it is aborted
printf(
"AcapWaitEvent was aborted.¥n"
);
}
}
// Cancel event setting
rtn = AcapSetEvent(hDevice, channel, ACL_INT_FRAMEEND, FALSE);
Содержание APX-3302
Страница 1: ...APX 3302 User s Manual ...