Cirrus Logic CS485 Especificaciones Pagina 45

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 319
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 44
ErrorHandling
3-9
3
ErrorMacros
TheerrormacrosassociatedwiththeiplError()functionaredescribed
below.
#defineIPL_ERROR(
status
,
func
,
context
)\
iplError((
status
),(
func
),(
context
));
#defineIPL_ERRCHK(
func
,
context
)\
((iplGetErrStatus()>=0)?IPL_StsOk\
:IPL_ERROR(IPL_StsBackTrace,(
func
),(
context
)) )
#defineIPL_ASSERT(
expr
,
func
,
context
)\
((expr)?IPL_StsOk\
:IPL_ERROR(IPL_StsInternal,(
func
),(
context
)) )
#defineIPL_RSTERR() (iplSetErrStatus(IPL_StsOk))
context
Providesadditionalinformationaboutthecontextin
whichtheerrorhasoccurred.Ifthevalueof
context
isNULLorempty,thisstringdoesnot
appearintheerrormessage.
expr
Anexpressionthatchecksforanerrorcondition
andreturns
FALSEifanerrorhasoccurred.
func
Nameofthefunctionwheretheerroroccurred.
status
Codethatindicatesthetypeoferror(seeTable3-1,
iplError()StatusCodes.”)
Discussion
TheIPL_ASSERT()macrochecksfortheerrorcondition
expr
and sets the
errorstatus
IPL_StsInternaliftheerroroccurred.
The
IPL_ERRCHK()macrocheckstoseeifanerrorhasoccurredby
checkingtheerrorstatus.Ifanerrorhasoccurred,IPL_ERRCHK()creates
anerrorbacktracemessageandreturnsanon-zerovalue.Thismacro
shouldnormallybeusedafteranycalltoafunctionthatmighthave
signaledanerror.
Vista de pagina 44
1 2 ... 40 41 42 43 44 45 46 47 48 49 50 ... 318 319

Comentarios a estos manuales

Sin comentarios