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:
parent
711ed082a2
commit
2f8af56042
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue