Cirrus Logic CS485 Specifiche Pagina 49

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 319
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 48
Error Handling
3-13
3
Error Handling Example
The following example describes the default error handling for a console
application. In the example program,
test.c, assume that the function
libFuncB() represents a library function such as ipl?AddS(), and the
function
libFuncD() represents a function that is called internally to the
library. In this scenario,
main() and appFuncA() represent application
code.
Thevalueoftheerrormodeissetto
IPL_ErrModeParent.The
IPL_ErrModeParent option produces a more detailed account of the error
conditions.
Example 3-1 Error Functions
/* application main function */
main() {
iplSetErrMode(IPL_ErrModeParent);
appFuncA(5, 45, 1.0);
if (IPL_ERRCHK("main","compute something")) exit(1);
return 0;
}
/* application subroutine */
void appFuncA(int order1, int order2, double a) {
libFuncB(a, order1);
if (IPL_ERRCHK("appFuncA","compute using order1")) return;
libFuncB(a, order2);
if (IPL_ERRCHK("appFuncA","compute using order2")) return;
}
/* do some more work */
continued
Vedere la pagina 48
1 2 ... 44 45 46 47 48 49 50 51 52 53 54 ... 318 319

Commenti su questo manuale

Nessun commento