adapted to new list api.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user