drivers/segger: make RTT_MODE configurable

CHAMPION-2373

To allow use NO_BLOCK mode, so the system keeps running when debugger disconnected.

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
Xu Xingliang 2022-11-13 20:45:17 +08:00 committed by Xiang Xiao
parent 19ea8e74ae
commit d1be53e748
2 changed files with 22 additions and 1 deletions

View File

@ -62,6 +62,21 @@ config SEGGER_RTT_BUFFER_SIZE_DOWN
---help---
Size of the buffer for terminal input to target from host (Usually keyboard input)
choice
prompt "SEGGER_RTT_MODE"
default SEGGER_RTT_MODE_NO_BLOCK_SKIP
config SEGGER_RTT_MODE_NO_BLOCK_SKIP
bool "Skip. Do not block, output nothing. (Default)"
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 # SEGGER_RTT_MODE
if SEGGER_SYSVIEW
config SEGGER_SYSVIEW_RTT_BUFFER_SIZE

View File

@ -63,7 +63,13 @@
/* Mode for pre-initialized terminal channel */
#define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
#if defined(CONFIG_SEGGER_RTT_MODE_NO_BLOCK_TRIM)
# define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_NO_BLOCK_TRIM
#elif defined(SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL)
# define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
#else
# define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_NO_BLOCK_SKIP
#endif
/* 0: Use memcpy/SEGGER_RTT_MEMCPY, 1: Use a simple byte-loop */