adapted to new list api.

This commit is contained in:
Gatsby Van
2023-12-23 17:01:58 +08:00
parent d746215628
commit 6ab4293c76
2 changed files with 32 additions and 10 deletions
+14 -4
View File
@@ -40,11 +40,21 @@ static void schdevent_free(void* val){
/**
* @brief helper function to match events by ids.
*/
static bool schdevent_match(void* a, void* b){
static int8_t schdevent_compare(void* a, void* b){
ASSERT(a == NULL);
ASSERT(b != NULL);
return (((L2_SCHD_EVENT*)a)->eventId
== ((L2_SCHD_EVENT*)b)->eventId);
register uint32_t idA, idB;
idA = ((L2_SCHD_EVENT*)a)->eventId;
idB = ((L2_SCHD_EVENT*)b)->eventId;
if( idA== idB) {
return 0;
}
else if (idA < idB) {
return -1;
}
else {
return 1;
}
}
/*****************************************************************************/
@@ -69,7 +79,7 @@ int32_t L2_CreateSchedEventPool(L2_SCHD_POOL** schdPool) {
return EALLOC;
}
(*schdPool)->schdList->free = schdevent_free;
(*schdPool)->schdList->match = schdevent_match;
(*schdPool)->schdList->compare = schdevent_compare;
(*schdPool)->envCnt = 0;
return SUCCESS;
}