J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
363
13.4.1.4 SEGGER_RTT_HasKey()
Description
Checks if at least one character for reading is available in SEGGER RTT buffer. 0
Prototype
int SEGGER_RTT_HasKey (void);
Return value
Example
if (SEGGER_RTT_HasKey()) {
int c = SEGGER_RTT_GetKey();
}
13.4.1.5 SEGGER_RTT_Init()
Description
Initializes the RTT Control Block.
Prototype
void SEGGER_RTT_Init (void);
Additional information
Should be used in RAM targets, at start of the application.
13.4.1.6 SEGGER_RTT_printf()
Description
Send a formatted string to the host.
Prototype
int SEGGER_RTT_printf (unsigned BufferIndex, const char * sFormat, ...)
Parameters
Return value
Example
SEGGER_RTT_printf(0, "SEGGER RTT Sample. Uptime: %.10dms.", /*OS_Time*/ 890912);
// Formatted output on channel 0: SEGGER RTT Sample. Uptime: 890912ms.
Additional information
(1) Conversion specifications have following syntax:
• %[flags][FieldWidth][.Precision]ConversionSpecifier
0 No characters are available to be read.
1 At least one character is available in the buffer.
Parameter Meaning
BufferIndex
Index of the up channel to sent the string to.
sFormat Pointer to format string, followed by arguments for conversion.
Table 13.3: SEGGER_RTT_printf() parameter list
>= 0 Number of bytes which have been sent.
< 0 Error.