Masterclock TCR1000 Manual de usuario Pagina 17

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 23
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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 pagina 16
1 2 ... 12 13 14 15 16 17 18 19 20 21 22 23

Comentarios a estos manuales

Sin comentarios