Page 1 of 1

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

Posted: Thu Jun 14, 2018 9:53 am
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)

Re: Add inline to set queue user defined link field

Posted: Fri Jun 15, 2018 10:14 am
by Giovanni
Hi,

Added to trunk.

Giovanni