Skip to content

Commit

Permalink
Returning number of bytes written to uart console.
Browse files Browse the repository at this point in the history
  • Loading branch information
arun-silabs committed Feb 27, 2024
1 parent 7aeb6c3 commit 8eacef4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/platform/silabs/SiWx917/uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ extern "C" {

#define USART_BAUDRATE 115200 // Baud rate <9600-7372800>
#define UART_CONSOLE_ERR -1 // Negative value in case of UART Console action failed. Triggers a failure for PW_RPC
#define UART_CONSOLE_SUCCESS 1 // Positive value if UART Console action is success.

sl_usart_handle_t usart_handle;

Expand Down Expand Up @@ -132,15 +131,15 @@ int16_t uartLogWrite(const char * log, uint16_t length)
{
return UART_CONSOLE_ERR;
}
for (/* Empty */; length != 0; --length)
for (int i = 0; i < length; i++)
{
Board_UARTPutChar(*log++);
}
// To print next log in new line with proper formatting
Board_UARTPutChar('\r');
Board_UARTPutChar('\n');

return UART_CONSOLE_SUCCESS;
return length;
}

/*
Expand Down

0 comments on commit 8eacef4

Please sign in to comment.