Skip to content

Commit 9661d3b

Browse files
MariuszSkamratheob-pro
authored andcommitted
[nrf fromtree] Bluetooth: monitor: Fix SEGGER RTT compilation error
This fixes out of scope IRQ lock key by using SEGGER_RTT_Write version that locks the IRQ by itself. Signed-off-by: Mariusz Skamra <[email protected]> (cherry picked from commit 27c18ad)
1 parent 60cd202 commit 9661d3b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

subsys/bluetooth/host/monitor.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,12 @@ static void monitor_send(const void *data, size_t len)
126126
}
127127

128128
if (!drop) {
129-
if (!panic_mode) {
130-
SEGGER_RTT_LOCK();
131-
}
132-
cnt = SEGGER_RTT_WriteNoLock(CONFIG_BT_DEBUG_MONITOR_RTT_BUFFER,
133-
rtt_buf, rtt_buf_offset);
134-
if (!panic_mode) {
135-
SEGGER_RTT_UNLOCK();
129+
if (panic_mode) {
130+
cnt = SEGGER_RTT_WriteNoLock(CONFIG_BT_DEBUG_MONITOR_RTT_BUFFER,
131+
rtt_buf, rtt_buf_offset);
132+
} else {
133+
cnt = SEGGER_RTT_Write(CONFIG_BT_DEBUG_MONITOR_RTT_BUFFER,
134+
rtt_buf, rtt_buf_offset);
136135
}
137136
}
138137

0 commit comments

Comments
 (0)