/* Get the a buffer from the DAP_queue where the response to the request is stored Parameters: queue - DAP queue, buf = return the buffer location, len = return the len of the response Return Value: TRUE - Success, FALSE - Error  */
BOOL DAP_queue_get_send_buf(DAP_queue *queue, uint8_t **buf, int *len)
/* Get the a buffer from the DAP_queue where the response to the request is stored Parameters: queue - DAP queue, buf = return the buffer location, len = return the len of the response Return Value: TRUE - Success, FALSE - Error  */
BOOL DAP_queue_get_send_buf(DAP_queue *queue, uint8_t **buf, int *len)
{
    if (queue->send_count) {
        queue->send_count--;
        *buf = queue->USB_Request[queue->send_idx];
        *len = queue->resp_size[queue->send_idx];
        queue->send_idx = (queue->send_idx + 1) % DAP_PACKET_COUNT;
        queue->free_count++;
        return (__TRUE);
    }
    return (__FALSE);
}