UART documentation bug? Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

UART documentation bug?

Post 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
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: UART documentation bug?

Post 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
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: UART documentation bug?

Post by Giovanni »

Lets keep the documentation and fix the code, the fix is not that complex and only in the high level driver.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: UART documentation bug?

Post by Giovanni »

Fixed as bug #883.

thanks,
Giovanni
Post Reply