Misleading error flag in uart.c
Posted: Sun Oct 08, 2017 10:41 am
Hi,
This got me scratching my head for awhile. In uart.c there are a few assertion type checks at the beginning of the function uart_read_bytes():
I think the second check in the code above should actually return a "buffer is null" error? As it is now, if there is a problem with the buffer the result will indicate incorrect UART number.
This got me scratching my head for awhile. In uart.c there are a few assertion type checks at the beginning of the function uart_read_bytes():
Code: Select all
int uart_read_bytes(uart_port_t uart_num, uint8_t* buf, uint32_t length, TickType_t ticks_to_wait)
{
UART_CHECK((uart_num < UART_NUM_MAX), "uart_num error", (-1));
UART_CHECK((buf), "uart_num error", (-1)); //<---
...
}