logging: rtt: Do not retry on error in non blocking mode

Retry in non blocking mode can lead to a quite long (busy) wait.
Refs #28211

Signed-off-by: Guillaume Lager <guillaume.lager@gmail.com>
This commit is contained in:
Guillaume Lager 2020-09-09 17:29:51 +02:00 committed by Maureen Helm
commit cb91977c48

View file

@ -201,7 +201,10 @@ static void on_write(int retry_cnt)
static int data_out_block_mode(uint8_t *data, size_t length, void *ctx)
{
int ret = 0;
int retry_cnt = CONFIG_LOG_BACKEND_RTT_RETRY_CNT;
/* This function is also called in drop mode for synchronous operation
* in that case retry is undesired */
int retry_cnt = IS_ENABLED(CONFIG_LOG_BACKEND_RTT_MODE_BLOCK) ?
CONFIG_LOG_BACKEND_RTT_RETRY_CNT : 1;
do {
if (!is_sync_mode()) {