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.
#define qSetLink(qp, lk) ((qp)->q_link = lk)