drivers: console: rtt_console: use Segger recommended write API

Use recommended write API that internally locks RTT usage and checks
if the RTTcontrol block initialization is done.

Signed-off-by: Giancarlo Stasi <giancarlo.stasi.co@gmail.com>
This commit is contained in:
Giancarlo Stasi 2023-04-14 16:17:44 +02:00 committed by Carles Cufí
parent 711ed082a2
commit 2f8af56042
1 changed files with 1 additions and 3 deletions

View File

@ -40,9 +40,7 @@ static int rtt_console_out(int character)
int max_cnt = CONFIG_RTT_TX_RETRY_CNT;
do {
SEGGER_RTT_LOCK();
cnt = SEGGER_RTT_WriteNoLock(0, &c, 1);
SEGGER_RTT_UNLOCK();
cnt = SEGGER_RTT_Write(0, &c, 1);
/* There are two possible reasons for not writing any data to
* RTT: