OS_Printf

Syntax

#include <nitro/os.h>

void OS_Printf( const char *fmt, ... );

Arguments

fmt Output format string.
... Variable number of arguments.

Return Values

None.

Description

Outputs a string. A variable number of arguments can be given in accordance to the format string (output format string).

Example:
OS_Printf( "variable test = %d\n", test );

This function is compiled with weak symbols. Therefore, you can overwrite them with your own function definitions.

The maximum string length that can be displayed is 255 characters. If a string with 256 or more characters is specified, all characters from the 256th character are ignored.

This function is used for debugging. It does not generate any output during a FINALROM build or when linked against FINALROM libraries.

Note

The OS_Printf function consumes a lot of stack space. The IRQ stack used during interrupt and callback execution is not that big. Therefore, whenever possible, use the OS_TPrintf function, which is the lighter version, in deeply nested function calls in IRQ interrupts. When debug output freezes, you may be able to use the OS_TPrintf function instead to prevent this from occurring.

However, floating-point output is not supported by OS_TPrintf.

Output for the debugger can be switched between the blocking mode and the non-blocking mode. See OS_SetPrintBlockingMode for more details.

See Also

OS_PutString
OS_SetPrintBlockingMode
OS_GetPrintBlockingMode

Revision History

2009/10/02 Added the maximum displayable string length.
2009/04/03 Added information about proxy mode. Changed reference.
2004/11/25 Added description for weak symbols.
2003/12/01 Initial version.


CONFIDENTIAL