362 CHAPTER 13 RTT
J-Link / J-Trace (UM08001) ©
2004-2017 SEGGER Microcontroller GmbH & Co. KG
13.4.1.2 SEGGER_RTT_ConfigUpBuffer()
Description
Configure or add an up buffer by specifying its name, size and flags.
Prototype
int SEGGER_RTT_ConfigUpBuffer (unsigned BufferIndex, const char* sName,
char* pBuffer, int BufferSize, int Flags);
Parameters
Return value
Example
//
// Configure up channel 1 to work in blocking mode
//
SEGGER_RTT_ConfigUpChannel(1, "DataOut", &abDataOut[0], sizeof(abDataOut),
SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL);
Additional information
Once a channel is configured only the flags of the channel should be changed.
13.4.1.3 SEGGER_RTT_GetKey()
Description
Reads one character from SEGGER RTT buffer 0. Host has previously stored data
there.
Prototype
int SEGGER_RTT_GetKey (void);
Return value
Example
int c;
c = SEGGER_RTT_GetKey();
if (c == ’q’) {
exit();
}
Parameter Meaning
BufferIndex
Index of the buffer to configure. Must be lower than
SEGGER_RTT_MAX_NUM_UP_CHANNELS.
sName
Pointer to a 0-terminated string to be displayed as the name of the
channel.
pBuffer Pointer to a buffer used by the channel.
BufferSize Size of the buffer in Bytes.
Flags Flags of the channel (blocking or non-blocking).
Table 13.2: SEGGER_RTT_ConfigUpBuffer() parameter list
>= 0 O.K.
< 0 Error.
< 0 No character available (empty buffer).
>= 0 Character which has been read (0 - 255).