Skip to content

Commit

Permalink
logging: rtt: Fix RTT message dropped warning not displayed
Browse files Browse the repository at this point in the history
Fix data_out_block_mode() to return the data correctly sent to RTT.
Before this fixes, it was always returning `lenght`, even in situation
where data have been dropped. This was leading to not having the dropped
messages warning displayed.

Fixes zephyrproject-rtos#21514

Signed-off-by: Xavier Chapron <[email protected]>
  • Loading branch information
Xavier Chapron authored and nashif committed Jul 7, 2020
1 parent 85acfd2 commit 71d84ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/logging/log_backend_rtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static int data_out_block_mode(uint8_t *data, size_t length, void *ctx)
}
} while ((ret == 0) && host_present);

return ((ret == 0) && host_present) ? 0 : length;
return ret ? length : 0;
}

LOG_OUTPUT_DEFINE(log_output, IS_ENABLED(CONFIG_LOG_BACKEND_RTT_MODE_BLOCK) ?
Expand Down

0 comments on commit 71d84ef

Please sign in to comment.