Add inline to set queue user defined link field Topic is solved

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
User avatar
FXCoder
Posts: 384
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 180 times
Been thanked: 130 times

Add inline to set queue user defined link field  Topic is solved

Postby FXCoder » Thu Jun 14, 2018 9:53 am

Hi,
Normally when using hal_queues the user defined link is set when the queue object is initialized.
However, if the user defined link field needs to be updated while the queue is in use a small inline is needed.
For example when using combined buffer/queue objects that can be chained dynamically using the user defined link field.

Maybe this would be a useful addition to hal_queues.h...

Code: Select all


/**
 * @brief   Sets the queue application-defined link.
 * @note    This function can be called in any context.
 *
 * @param[in] qp        pointer to a @p io_queue_t structure
 * @param[in] lk        The application-defined link.
 *
 * @special
 */
#define qSetLink(qp, lk) ((qp)->q_link = lk)

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Add inline to set queue user defined link field

Postby Giovanni » Fri Jun 15, 2018 10:14 am

Hi,

Added to trunk.

Giovanni


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 8 guests