Skip to content

Commit 8eacef4

Browse files
committed
Returning number of bytes written to uart console.
1 parent 7aeb6c3 commit 8eacef4

File tree

1 file changed

+2
-3
lines changed
  • examples/platform/silabs/SiWx917

1 file changed

+2
-3
lines changed

examples/platform/silabs/SiWx917/uart.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ extern "C" {
3232

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

3736
sl_usart_handle_t usart_handle;
3837

@@ -132,15 +131,15 @@ int16_t uartLogWrite(const char * log, uint16_t length)
132131
{
133132
return UART_CONSOLE_ERR;
134133
}
135-
for (/* Empty */; length != 0; --length)
134+
for (int i = 0; i < length; i++)
136135
{
137136
Board_UARTPutChar(*log++);
138137
}
139138
// To print next log in new line with proper formatting
140139
Board_UARTPutChar('\r');
141140
Board_UARTPutChar('\n');
142141

143-
return UART_CONSOLE_SUCCESS;
142+
return length;
144143
}
145144

146145
/*

0 commit comments

Comments
 (0)