add support for dynaminc sem and dynamic mutex

This commit is contained in:
mculover666
2021-03-11 09:46:24 +08:00
parent 54022c2481
commit da61aa0a49
8 changed files with 182 additions and 7 deletions

View File

@@ -61,6 +61,35 @@ __API__ k_err_t tos_sem_create_max(k_sem_t *sem, k_sem_cnt_t init_count, k_sem_c
*/
__API__ k_err_t tos_sem_create(k_sem_t *sem, k_sem_cnt_t init_count);
/**
* @brief Create a dynamic semaphore with a limitation of maximum count.
* create a dynamic semaphore with a limitation of maximum count.
*
* @attention None
*
* @param[in] sem pointer to the pointer of the semaphore.
* @param[in] init_count initial count of the semaphore.
* @param[in] max_count maximum count of the semaphore.
*
* @return errcode
* @retval #K_ERR_NONE return successfully.
*/
__API__ k_err_t tos_sem_create_max_dyn(k_sem_t **sem, k_sem_cnt_t init_count, k_sem_cnt_t max_count);
/**
* @brief Create a dynamic semaphore.
* create a dynamic semaphore.
*
* @attention None
*
* @param[in] sem pointer to the pointer of the semaphore.
* @param[in] init_count initial count of the semaphore.
*
* @return errcode
* @retval #K_ERR_NONE return successfully.
*/
__API__ k_err_t tos_sem_create_dyn(k_sem_t **sem, k_sem_cnt_t init_count);
/**
* @brief Destroy a semaphore.
* destroy a semaphore.