UART documentation bug? Topic is solved

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

UART documentation bug?  Topic is solved

Postby Marco » Tue Sep 05, 2017 12:48 pm

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: UART documentation bug?

Postby Giovanni » Tue Sep 05, 2017 12:59 pm

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: UART documentation bug?

Postby Giovanni » Tue Sep 05, 2017 1:06 pm

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: UART documentation bug?

Postby Giovanni » Tue Sep 05, 2017 1:13 pm

Fixed as bug #883.

thanks,
Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 8 guests