serial: bluetooth: Print warning once when ring buffer is full

This avoids cluttering the logging subsystem.

Signed-off-by: David T. Pocock <davidtpocock@gmail.com>
This commit is contained in:
David T. Pocock 2024-08-22 20:54:42 +01:00 committed by Anas Nashif
commit b2475804f8

View file

@ -160,7 +160,7 @@ static void uart_bt_poll_out(const struct device *dev, unsigned char c)
/** Right now we're discarding data if ring-buf is full. */ /** Right now we're discarding data if ring-buf is full. */
while (!ring_buf_put(ringbuf, &c, 1)) { while (!ring_buf_put(ringbuf, &c, 1)) {
if (k_is_in_isr() || !atomic_get(&dev_data->bt.enabled)) { if (k_is_in_isr() || !atomic_get(&dev_data->bt.enabled)) {
LOG_INF("Ring buffer full, discard %c", c); LOG_WRN_ONCE("Ring buffer full, discard %c", c);
break; break;
} }