drivers/segger: Add STREAM_RTT option

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-11-28 02:11:33 +08:00 committed by Petro Karashchenko
parent ac365ab7e9
commit fd268d7123
5 changed files with 13 additions and 2 deletions

View File

@ -68,5 +68,6 @@ CONFIG_SCHED_WAITPID=y
CONFIG_SEGGER_SYSVIEW=y
CONFIG_START_MONTH=6
CONFIG_START_YEAR=2008
CONFIG_STREAM_RTT=y
CONFIG_SYSLOG_RTT=y
CONFIG_SYSTEM_NSH=y

View File

@ -78,6 +78,13 @@ endchoice # SEGGER_RTT_MODE
endif # SEGGER_RTT
config STREAM_RTT
bool "Stream to/from Segger J-Link RTT"
select SEGGER_RTT
default n
---help---
Use Segger J-Link RTT as a stream input and output.
if SEGGER_SYSVIEW
config SEGGER_SYSVIEW_RTT_CHANNEL

View File

@ -54,7 +54,7 @@ TARGET_ZIP += $(SGDIR)/RTT.zip
endif
ifeq ($(CONFIG_SEGGER_RTT),y)
ifeq ($(CONFIG_STREAM_RTT),y)
CSRCS += segger/stream_rtt.c
endif

View File

@ -25,7 +25,6 @@
#include <assert.h>
#include <stdio.h>
#include <nuttx/config.h>
#include <nuttx/kmalloc.h>
#include <nuttx/streams.h>
#include <nuttx/segger/rtt.h>

View File

@ -36,6 +36,7 @@
* Type Declarations
****************************************************************************/
#ifdef CONFIG_STREAM_RTT
struct lib_rttoutstream_s
{
struct lib_outstream_s public;
@ -51,6 +52,7 @@ struct lib_rttinstream_s
FAR char *buffer;
int channel;
};
#endif
/****************************************************************************
* Public Function Prototypes
@ -61,6 +63,7 @@ extern "C"
{
#endif
#ifdef CONFIG_STREAM_RTT
/****************************************************************************
* Name: lib_rttoutstream_open
*****************************************************************************/
@ -86,6 +89,7 @@ void lib_rttinstream_open(FAR struct lib_rttinstream_s *stream,
****************************************************************************/
void lib_rttinstream_close(FAR struct lib_rttinstream_s *stream);
#endif
#ifdef __cplusplus
}