SYS Module
Application Program Interface
2-453
❏
Abort Function
. The function to run if the application aborts by
calling SYS_abort. The default function is _UTL_doAbort, which logs
an error message and calls _halt. If you are using Tconf, do not add
an underscore before the function name; Tconf adds the underscore
needed to call a C function from assembly internally. The prototype
for this function should be:
Void myAbort(String fmt, va_list ap);
Tconf Name: ABORTFXN
Type: Extern
Example:
bios.SYS.ABORTFXN =
prog.extern("myAbort");
❏
Error Function
. The function to run if an error flagged by SYS_error
occurs. The default function is _UTL_doError, which logs an error
message and returns. The prototype for this function should be:
Void myError(String s, Int errno, va_list ap);
Tconf Name: ERRORFXN
Type: Extern
Example:
bios.SYS.ERRORFXN =
prog.extern("myError");
❏
Exit Function
. The function to run when the application exits by
calling SYS_exit. The default function is UTL_halt, which loops
forever with interrupts disabled and prevents other processing. The
prototype for this function should be:
Void myExit(Int status);
Tconf Name: EXITFXN
Type: Extern
Example:
bios.SYS.EXITFXN =
prog.extern("myExit");
❏
Putc Function
. The function to run if the application calls
SYS_putchar, SYS_printf, or SYS_vprintf. The default function is
_UTL_doPutc, which writes a character to the system trace buffer.
This system trace buffer can be viewed only by looking for the
SYS_PUTCBEG symbol in the Code Composer Studio memory
view. The prototype for this function should be:
Void myPutc(Char c);
Tconf Name: PUTCFXN
Type: Extern
Example:
bios.SYS.PUTCFXN =
prog.extern("myPutc");
SYS Object Properties
The SYS module does not support the creation of individual SYS objects.