Page 1 of 1

UART documentation bug?

Posted: Tue Sep 05, 2017 12:48 pm
by Marco
Hi Giovanni,

In hal_uart.c, uartSendTimeout(), uartSendFullTimeout() and uartReceiveTimeout() documentation states:

Code: Select all

@param[in,out] np    number of data frames to receive, on exit the number
                     of frames actually received

On error/timeout, these functions call uartStopSendI() or uartStopReceiveI(). The documentation of these functions states:

Code: Select all

@return              The number of data frames not transmitted by the
                     stopped transmit operation.
@retval 0            There was no transmit operation in progress.

@return              The number of data frames not received by the
                     stopped receive operation.
@retval 0            There was no receive operation in progress.

The documentation of uartSendTimeout(), uartSendFullTimeout() and uartReceiveTimeout() is wrong. The np parameter returns the number of frames NOT received/transmitted while the documentation states that it is the number of frames actually received/transmitted. Which one is correct, the documentation or the implementation?

Marco

Re: UART documentation bug?

Posted: Tue Sep 05, 2017 12:59 pm
by Giovanni
Moving to bug reports, I wish it to return the number of transmitted frames, probably it is easier to return the number of remaining frames because it can just return the DMA counter.

Giovanni

Re: UART documentation bug?

Posted: Tue Sep 05, 2017 1:06 pm
by Giovanni
Lets keep the documentation and fix the code, the fix is not that complex and only in the high level driver.

Giovanni

Re: UART documentation bug?

Posted: Tue Sep 05, 2017 1:13 pm
by Giovanni
Fixed as bug #883.

thanks,
Giovanni