Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions subsys/logging/backends/Kconfig.rtt
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,12 @@ config LOG_BACKEND_RTT_FORCE_PRINTK
default y if LOG_BACKEND_RTT_BUFFER = 0 && RTT_CONSOLE
select LOG_PRINTK

if LOG_BACKEND_RTT_OUTPUT_DICTIONARY

config LOG_BACKEND_RTT_OUTPUT_DICTIONARY_HEX
bool "Whether to output the dictionary log hex encoded (y) or as a raw binary (n)"
default y

endif # LOG_BACKEND_RTT_OUTPUT_DICTIONARY

endif # LOG_BACKEND_RTT
6 changes: 3 additions & 3 deletions subsys/logging/backends/log_backend_rtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define CONFIG_LOG_BACKEND_RTT_RETRY_CNT 10
#endif

#if defined(CONFIG_LOG_BACKEND_RTT_OUTPUT_DICTIONARY)
#if defined(CONFIG_LOG_BACKEND_RTT_OUTPUT_DICTIONARY_HEX)
static const uint8_t LOG_HEX_SEP[10] = "##ZLOGV1##";
#endif

Expand Down Expand Up @@ -259,7 +259,7 @@ static const log_output_func_t logging_func =

static int data_out(uint8_t *data, size_t length, void *ctx)
{
#if defined(CONFIG_LOG_BACKEND_RTT_OUTPUT_DICTIONARY)
#if defined(CONFIG_LOG_BACKEND_RTT_OUTPUT_DICTIONARY_HEX)
for (size_t i = 0; i < length; i++) {
char c[2];
uint8_t x[2];
Expand Down Expand Up @@ -294,7 +294,7 @@ static void log_backend_rtt_init(struct log_backend const *const backend)
log_backend_rtt_cfg();
}

#if defined(CONFIG_LOG_BACKEND_RTT_OUTPUT_DICTIONARY)
#if defined(CONFIG_LOG_BACKEND_RTT_OUTPUT_DICTIONARY_HEX)
logging_func((uint8_t *)LOG_HEX_SEP, sizeof(LOG_HEX_SEP), NULL);
#endif

Expand Down