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.
Post Reply
User avatar
FXCoder
Posts: 403
Joined: Sun Jun 12, 2016 4:10 am
Has thanked: 188 times
Been thanked: 134 times

Add inline to set queue user defined link field

Post by FXCoder »

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: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Add inline to set queue user defined link field

Post by Giovanni »

Hi,

Added to trunk.

Giovanni
Post Reply