Both the enqueue operation in the ESB queue buffer (esb_write_payload) and the dequeue operation (esb_pop_tx) use ++tx_fifo.back.

In the enqueue function esb_write_payload, the enqueue implementation uses ++tx_fifo.back.

In the dequeue function esb_pop_tx, the dequeue processing also uses ++tx_fifo.back.

Is this reasonable?

  • Hello,

    I believe the implementation is correct.

    Enqueue: Adds items at the back (tail) pointer
    Dequeue: Removes items from the front (head) pointer

    Both pointers wrap around to 0 when they reach CONFIG_ESB_TX_FIFO_SIZE

    The dequeue operation modifies the front pointer, not the back pointer, which is the expected behavior.

    Hope that helps,
    Kenneth

Related