//刪除pxItemToRemove節點
UBaseType_t uxListRemove(ListItem_t *pxItemToRemove)
{ ? ? ? ? ? ? ?
//The list item knows which list it is in. ?Obtain the list from the list item.
//找到節點所在的鏈表
?? ?//my_printf( "uxListRemove pxItemToRemove = %#p\n", pxItemToRemove );
?? ?
List_t *pxList = pxItemToRemove->pxContainer;
List_t *pxList_; ? ? ? ? ?//指向目標優先級的就緒任務列表 (通過TCB的優先級索引)
//pxList_ = &pxReadyTasksLists[4];
?? ??? ?
?? ?//my_printf( "pxList = %#p\n", pxList );
//my_printf( "pxList->uxNumberOfItems = %d\n", pxList->uxNumberOfItems );
//my_printf( "&pxList->uxNumberOfItems = %#p\n", &pxList->uxNumberOfItems );
//my_printf( "pxList->pxIndex = %#p\n", pxList->pxIndex );
//my_printf( "&pxList->pxIndex = %#p\n", &pxList->pxIndex );
//my_printf( "pxList->pxIndex->pvOwner = %#p\n", pxList->pxIndex->pvOwner );
//my_printf( "pxList->pxIndex->pxContainer = %#p\n", pxList->pxIndex->pxContainer );
?? ?//|------->volatile UBaseType_t uxNumberOfItems = 1 ?0x20000088 ?鏈表中元素的個數 ? ? ? ? ?
//| |<-----ListItem_t *pxIndex;?? ??? ??? ??? ??? ? ? ? 0x2000008c ?總是指向xListEnd節點,在鏈表尾部插入的時候,方便找到位置
//| | ?|-->TickType_t xItemValue = portMAX_DELAY ? ? 0x20000090 ?[MiniListItem_t xListEnd] ??
//| | ?| ? struct xLIST_ITEM *pxNext; ? ? ----->| ? ?0x20000094 ?后繼節點
//| | ?| ? struct xLIST_ITEM *pxPrevious; ----->| ? ?0x20000098 ?前驅節點?? ?
//| | ?| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? ? ? ? ? ? ? ? ?
//| |--|-->TickType_t xItemValue; <-------------| ? ?0x200004ac ?鏈表節點的值 ? ? ? ?
//| ? ?|<--struct xLIST_ITEM *pxNext; ? ? ? ? ? ? ? ? ? ? ? ? ? ?后繼節點
//| ? ?|<--struct xLIST_ITEM *pxPrevious; ? ? ? ? ? ? ? ? ? ? ? ?前驅節點
//| ? ? ? ?void *pvOwner; ? ? ? ? ? ? ? ? ? ? ? ? ? ?0x200004a8 ?保存私有數據 ? ? ? ? [ &TCB ]
//|<------ struct xLIST *pxContainer; ? ? ? ? ? ? ? ?0x20000088 ?節點所在的鏈表 [ &pxReadyTasksLists[x] ]
? ? pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
? ? //Make sure the index is left pointing to a valid item.?
if( pxList->pxIndex == pxItemToRemove ){
pxList->pxIndex = pxItemToRemove->pxPrevious;
}
pxItemToRemove->pxContainer = NULL;
pxList->uxNumberOfItems--;
// ? ? ? ? volatile UBaseType_t uxNumberOfItems = 0 ?0x20000088 ?鏈表中元素的個數 ? ? ? ? ?
// ?|<-----ListItem_t *pxIndex;?? ??? ??? ??? ??? ? ? ? 0x2000008c ?總是指向xListEnd節點,在鏈表尾部插入的時候,方便找到位置
// ?|->|-->TickType_t xItemValue = portMAX_DELAY ? ? 0x20000090 ?[MiniListItem_t xListEnd] ??
// ? ? |<--struct xLIST_ITEM *pxNext; ? ? ? ? ? ? ? ?0x20000094 ?后繼節點
// ? ? |<--struct xLIST_ITEM *pxPrevious; ? ? ? ? ? ?0x20000098 ?前驅節點?? ?
//返回剩余節點數
return pxList->uxNumberOfItems;
}