Commit 87b06414 authored by Pavel Kral's avatar Pavel Kral Committed by Carles Cufí
Browse files

logger: console: init rtt only once



As RTT is used by more subsystem in Zephyr, initialization is moved
from RTT console and RTT logger backend to common kernel init phase.

Signed-off-by: default avatarPavel Kral <pavel.kral@omsquare.com>
parent 870a3055
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@
 */

#include <kernel.h>
#include <init.h>
#include "SEGGER_RTT.h"

/*
 * Common mutex for locking access to terminal buffer.
@@ -18,3 +20,12 @@
 */

K_MUTEX_DEFINE(rtt_term_mutex);

static int rtt_init(struct device *unused)
{
	ARG_UNUSED(unused);

	SEGGER_RTT_Init();
}

SYS_INIT(rtt_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
 No newline at end of file