fix:The SWTMR_ALIGN timer calculates the count error for the same period, and for the same response time, the later-inserted node should be behind the existing node.

Close #I3PS5B

Change-Id: I15317e64ea3376a4880e8eb0a3af3e3e8449ba08
This commit is contained in:
zhushengle 2021-05-06 10:37:24 +08:00
parent 1f725147f3
commit 5cda1e77cc
2 changed files with 5 additions and 2 deletions

View File

@ -58,9 +58,12 @@ STATIC INLINE VOID OsAddNode2SortLink(SortLinkAttribute *sortLinkHeader, SortLin
}
SortLinkList *listSorted = LOS_DL_LIST_ENTRY(head->pstNext, SortLinkList, sortLinkNode);
if (listSorted->responseTime >= sortList->responseTime) {
if (listSorted->responseTime > sortList->responseTime) {
LOS_ListAdd(head, &sortList->sortLinkNode);
return;
} else if (listSorted->responseTime == sortList->responseTime) {
LOS_ListAdd(head->pstNext, &sortList->sortLinkNode);
return;
}
LOS_DL_LIST *prevNode = head->pstPrev;

View File

@ -158,7 +158,7 @@ VOID OsSwtmrFindAlignPos(UINT64 currTime, SWTMR_CTRL_S *swtmr)
}
/* find same interval timer, directly return */
if (cur->uwInterval == swtmr->uwInterval) {
swtmr->uwCount = 0;
swtmr->uwCount = OsSortLinkGetTargetExpireTime(currTime, &cur->stSortList);
return;
}