apache / mynewt-nimble

Apache mynewt
https://mynewt.apache.org/
Apache License 2.0
664 stars 384 forks source link

Semaphore maximum count is hardcoded to 128 #144

Open afesheir opened 5 years ago

afesheir commented 5 years ago

In the API: ble_npl_sem_init, there is no way to define the maximum count for the semaphore being created, and this is left to the OS-specific implementation, like the API: npl_freertos_sem_init that defines this max value to 128.

Proposed solution: Add additional argument to the API: ble_npl_sem_init to define the maximum semaphore count, and this max value is to be passed to the OS-specific implementation.

andrzej-kaczmarek commented 5 years ago

we only use binary semaphores in NimBLE so it probably makes sense to just assume ble_npl_sem_init creates binary semaphore. if we need standard semaphore in future, we'll add dedicated API to initialize it.