simplelink: dpl: Fix SemaphoreP initialization

When creating or constructing a semaphore, the count passed in is
incorrectly being ignored. We need to fix SemaphoreP_create/construct
to pass the initial count to k_sem_init().

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
This commit is contained in:
Vincent Wan 2020-02-07 13:03:52 -08:00 committed by Kumar Gala
parent ab9b289a10
commit b25d4b83b1
1 changed files with 2 additions and 2 deletions

View File

@ -79,7 +79,7 @@ SemaphoreP_Handle SemaphoreP_create(unsigned int count,
sem = dpl_sem_pool_alloc();
if (sem) {
k_sem_init(sem, 0, limit);
k_sem_init(sem, count, limit);
}
return (SemaphoreP_Handle)sem;
@ -154,7 +154,7 @@ SemaphoreP_Handle SemaphoreP_construct(SemaphoreP_Struct *handle,
sem = (struct k_sem *)handle;
if (sem) {
k_sem_init(sem, 0, limit);
k_sem_init(sem, count, limit);
}
return (SemaphoreP_Handle)sem;