This is an automated email from the ASF dual-hosted git repository.

kasjer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit c2b874b50bc24cf0bb2380cb1d0558e7a3d047ee
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Thu Jun 11 11:22:38 2026 +0200

    uart_console: Use ring_buffer API for init
    
    Ring buffer is now initialized with function call
    instead of direct filed manipulation
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 sys/console/full/src/uart_console.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sys/console/full/src/uart_console.c 
b/sys/console/full/src/uart_console.c
index 7eae5b126..9ab1fd8fe 100644
--- a/sys/console/full/src/uart_console.c
+++ b/sys/console/full/src/uart_console.c
@@ -251,13 +251,11 @@ uart_console_init(void)
         .uc_rx_char = uart_console_rx_char,
     };
 
-    cr_tx.size = MYNEWT_VAL(CONSOLE_UART_TX_BUF_SIZE);
-    cr_tx.buf = cr_tx_buf;
+    ring_buffer_init(&cr_tx, cr_tx_buf, MYNEWT_VAL(CONSOLE_UART_TX_BUF_SIZE));
     write_char_cb = uart_console_queue_char;
 
 #if MYNEWT_VAL(CONSOLE_UART_RX_BUF_SIZE) > 0
-    cr_rx.size = MYNEWT_VAL(CONSOLE_UART_RX_BUF_SIZE);
-    cr_rx.buf = cr_rx_buf;
+    ring_buffer_init(&cr_rx, cr_rx_buf, MYNEWT_VAL(CONSOLE_UART_RX_BUF_SIZE));
 
     rx_ev.ev_cb = uart_console_rx_char_event;
 #endif

Reply via email to