1 /*
2  * Copyright (c) 2018 omSquare s.r.o.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/kernel.h>
8 #include <zephyr/irq.h>
9 #include <zephyr/init.h>
10 #include "SEGGER_RTT.h"
11 
rtt_init(void)12 static int rtt_init(void)
13 {
14 	SEGGER_RTT_Init();
15 
16 	return 0;
17 }
18 
zephyr_rtt_irq_lock(void)19 unsigned int zephyr_rtt_irq_lock(void)
20 {
21 	return irq_lock();
22 }
23 
zephyr_rtt_irq_unlock(unsigned int key)24 void zephyr_rtt_irq_unlock(unsigned int key)
25 {
26 	irq_unlock(key);
27 }
28 
29 SYS_INIT(rtt_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
30