/*-----------------------------------------------------------*/
void vListInsertEnd(List_t *const pxList, ListItem_t *const pxNewListItem)
{
ListItem_t *const pxIndex = pxList->pxIndex;
/* Only effective when configASSERT() is also defined, these tests may catch the list data structures being overwritten in memory.
They will not catch data errors caused by incorrect configuration or use of FreeRTOS. */
/*只有在还定义了configASSERT()时才有效,这些测试可能会捕获内存中被覆盖的链表数据结构。他们不会捕捉到由于不正确的配置或使用FreeRTOS而导致的数据错误*/
listTEST_LIST_INTEGRITY(pxList);
listTEST_LIST_ITEM_INTEGRITY(pxNewListItem);
/* Insert a new list item into pxList, but rather than sort the list,
makes the new list item the last item to be removed by a call to listGET_OWNER_OF_NEXT_ENTRY(). */
/*在pxList中插入一个新链表项,但不是对链表进行排序,而是通过调用listGET_OWNER_OF_NEXT_ENTRY()使新链表项成为最后一个要访问的项*/
pxNewListItem->pxNext = pxIndex;
pxNewListItem->pxPrevious = pxIndex->pxPrevious;
/* Only used during decision coverage testing. */
/*仅在决策覆盖率测试期间使用*/
mtCOVERAGE_TEST_DELAY();
pxIndex->pxPrevious->pxNext = pxNewListItem;
pxIndex->pxPrevious = pxNewListItem;
/* Remember which list the item is in. */
/*记住该节点所在的链表*/
pxNewListItem->pvContainer = (void *)pxList;
/* 链表节点计数器++ */
(pxList->uxNumberOfItems)++;
}
/*-----------------------------------------------------------*/
FreeRTOS中将节点插入链表尾部 详细过程如下图 ,参考<[野火®]《FreeRTOS 内核实现与应用开发实战—基于STM32》>