Masterclock TCR1000 Manual do Utilizador Página 17

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 23
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 16
TCR1000SDKRev.3.0.0  Page17
TheAsynchronousCallbackFunction
Whenenabled,theAPIwillcallausersuppliedcallbackfunctionreportingtheactivationofinterrupts
ontheTCR.
AnexampleofthecallbackfunctioninC/C++:
DWORD_stdcallTCR1000_ApiAsyncCallback(DWORDdwStatus,PVOIDdata,DWORDdataLen)
{
PTCRTIMEtime;
switch(dwStatus)
{
caseASYNC_PERSEC:
//dataisapointertoaTCRTIMEdatastructureanddataLen=sizeof(TCRTIME)
time=(PTCRTIME)data;
break;
caseASYNC_TIMESET:
//dataisapointertoaTCRTIMEdatastructureanddataLen=sizeof(TCRTIME)
time=(PTCRTIME)data;
break;
caseASYNC_STARTTC:
//dataisapointertoaTCRTIMEdatastructureanddataLen=sizeof(TCRTIME)
time=(PTCRTIME)data;
break;
caseASYNC_ENDTC:
//dataisapointertoaTCRTIMEdatastructureanddataLen=sizeof(TCRTIME)
time=(PTCRTIME)data;
break;
caseASYNC_TIMELOSS:
//dataisNULLanddataLen=0
break;
caseASYNC_TIMEGAIN:
//dataisNULLanddataLen=0
break;
}
return(0);
}
Thecallbackfunctionmayhaveanynamethattheuserapplicationrequires,butmusthavetheexact
callingconventionandparameterdeclarationasshownabovetoavoidcorruptionofthestackwhen
thefunctioniscalledbytheAPI.
Vista de página 16
1 2 ... 12 13 14 15 16 17 18 19 20 21 22 23

Comentários a estes Manuais

Sem comentários