Skip to content

Commit

Permalink
samples: peripheral_uart: Fix hard-coded timeout value
Browse files Browse the repository at this point in the history
Calls to uart_rx_enable() require a timeout argument, for which
UART_WAIT_FOR_RX is used in 2 of 3 calls in this application.

The initial init call, however, uses a hardcoded value of 50
(milliseconds) instead of UART_WAIT_FOR_RX which is clearly an
oversight.

Signed-off-by: Michael Hunold <[email protected]>
  • Loading branch information
pideu-mh committed Oct 4, 2023
1 parent 201d1fc commit 9a43315
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samples/bluetooth/peripheral_uart/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ static int uart_init(void)
return err;
}

err = uart_rx_enable(uart, rx->data, sizeof(rx->data), 50);
err = uart_rx_enable(uart, rx->data, sizeof(rx->data), UART_WAIT_FOR_RX);
if (err) {
LOG_ERR("Cannot enable uart reception (err: %d)", err);
/* Free the rx buffer only because the tx buffer will be handled in the callback */
Expand Down

0 comments on commit 9a43315

Please sign in to comment.