ext: debug: segger: Move RTT configuration to KConfig
Extended KConfig to be able to control configuration present in SEGGER_RTT_Conf.h file. Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
5a1313f804
commit
e1ff7cef12
2 changed files with 57 additions and 7 deletions
|
@ -7,8 +7,50 @@
|
|||
config HAS_SEGGER_RTT
|
||||
bool
|
||||
|
||||
if HAS_SEGGER_RTT
|
||||
|
||||
config SEGGER_SYSTEMVIEW
|
||||
bool
|
||||
prompt "Segger SystemView support"
|
||||
depends on HAS_SEGGER_RTT
|
||||
select RTT_CONSOLE
|
||||
|
||||
config SEGGER_RTT_MAX_NUM_UP_BUFFERS
|
||||
int "Maximum number of up-buffers"
|
||||
default 3
|
||||
|
||||
config SEGGER_RTT_MAX_NUM_DOWN_BUFFERS
|
||||
int "Maximum number of down-buffers"
|
||||
default 3
|
||||
|
||||
config SEGGER_RTT_BUFFER_SIZE_UP
|
||||
int "Size of the buffer for terminal output of target, up to host"
|
||||
default 1024
|
||||
|
||||
config SEGGER_RTT_BUFFER_SIZE_DOWN
|
||||
int "Size of the buffer for terminal input of target, from host"
|
||||
default 16
|
||||
|
||||
config SEGGER_RTT_PRINTF_BUFFER_SIZE
|
||||
int "Size of buffer for RTT printf to bulk-send chars via RTT"
|
||||
default 64
|
||||
|
||||
choice
|
||||
prompt "Mode for pre-initialized terminal channel (buffer 0)"
|
||||
default SEGGER_RTT_MODE_NO_BLOCK_SKIP
|
||||
|
||||
config SEGGER_RTT_MODE_NO_BLOCK_SKIP
|
||||
bool "Skip. Do not block, output nothing."
|
||||
|
||||
config SEGGER_RTT_MODE_NO_BLOCK_TRIM
|
||||
bool "Trim: Do not block, output as much as fits."
|
||||
|
||||
config SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
|
||||
bool "Block: Wait until there is space in the buffer."
|
||||
|
||||
endchoice
|
||||
|
||||
config SEGGER_RTT_MODE
|
||||
int
|
||||
default 0 if SEGGER_RTT_MODE_NO_BLOCK_SKIP
|
||||
default 1 if SEGGER_RTT_MODE_NO_BLOCK_TRIM
|
||||
default 2
|
|
@ -67,6 +67,7 @@ Revision: $Rev: 4351 $
|
|||
#ifndef SEGGER_RTT_CONF_H
|
||||
#define SEGGER_RTT_CONF_H
|
||||
|
||||
#include <autoconf.h>
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <intrinsics.h>
|
||||
#endif
|
||||
|
@ -78,15 +79,22 @@ Revision: $Rev: 4351 $
|
|||
**********************************************************************
|
||||
*/
|
||||
|
||||
#define SEGGER_RTT_MAX_NUM_UP_BUFFERS (3) // Max. number of up-buffers (T->H) available on this target (Default: 3)
|
||||
#define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (3) // Max. number of down-buffers (H->T) available on this target (Default: 3)
|
||||
#define SEGGER_RTT_MAX_NUM_UP_BUFFERS CONFIG_SEGGER_RTT_MAX_NUM_UP_BUFFERS // Max. number of up-buffers (T->H) available on this target (Default: 3)
|
||||
#define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS CONFIG_SEGGER_RTT_MAX_NUM_DOWN_BUFFERS // Max. number of down-buffers (H->T) available on this target (Default: 3)
|
||||
|
||||
#define BUFFER_SIZE_UP (1024) // Size of the buffer for terminal output of target, up to host (Default: 1k)
|
||||
#define BUFFER_SIZE_DOWN (16) // Size of the buffer for terminal input to target from host (Usually keyboard input) (Default: 16)
|
||||
#define BUFFER_SIZE_UP CONFIG_SEGGER_RTT_BUFFER_SIZE_UP // Size of the buffer for terminal output of target, up to host (Default: 1k)
|
||||
#define BUFFER_SIZE_DOWN CONFIG_SEGGER_RTT_BUFFER_SIZE_DOWN // Size of the buffer for terminal input to target from host (Usually keyboard input) (Default: 16)
|
||||
|
||||
#define SEGGER_RTT_PRINTF_BUFFER_SIZE (64u) // Size of buffer for RTT printf to bulk-send chars via RTT (Default: 64)
|
||||
#define SEGGER_RTT_PRINTF_BUFFER_SIZE CONFIG_SEGGER_RTT_PRINTF_BUFFER_SIZE // Size of buffer for RTT printf to bulk-send chars via RTT (Default: 64)
|
||||
|
||||
#define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_NO_BLOCK_SKIP // Mode for pre-initialized terminal channel (buffer 0)
|
||||
// Mode for pre-initialized terminal channel (buffer 0)
|
||||
#if defined(CONFIG_SEGGER_RTT_MODE_NO_BLOCK_SKIP)
|
||||
#define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_NO_BLOCK_SKIP
|
||||
#elif defined(CONFIG_SEGGER_RTT_MODE_NO_BLOCK_TRIM)
|
||||
#define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_NO_BLOCK_TRIM
|
||||
#elif defined(CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL)
|
||||
#define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
|
||||
#endif
|
||||
|
||||
//
|
||||
// Target is not allowed to perform other RTT operations while string still has not been stored completely.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue