add a set of dyn(create / destroy) interface

1. tos_ring_q_create_dyn
2. tos_chr_fifo_create_dyn
3. tos_msg_q_create_dyn
4. tos_mail_q_create_dyn
5. tos_bin_heap_create_dyn
6. tos_prio_q_create_dyn
7. tos_prio_msg_q_create_dyn
8. tos_prio_mail_q_create_dyn
This commit is contained in:
daishengdong
2019-10-29 16:57:43 +08:00
parent 3615aaf3f4
commit c411ed1eec
92 changed files with 1800 additions and 86333 deletions

View File

@@ -21,6 +21,8 @@
#if TOS_CFG_MAIL_QUEUE_EN > 0u
typedef struct k_mail_queue_st {
knl_obj_t knl_obj;
pend_obj_t pend_obj;
k_ring_q_t ring_q;
} k_mail_q_t;
@@ -54,6 +56,38 @@ __API__ k_err_t tos_mail_q_create(k_mail_q_t *mail_q, void *pool, size_t mail_cn
*/
__API__ k_err_t tos_mail_q_destroy(k_mail_q_t *mail_q);
#if TOS_CFG_MMHEAP_EN > 0u
/**
* @brief Create a mail queue with dynamic allocated pool.
* create a mail queue with dynamic allocated pool.
*
* @attention a MAIL is a buffer with a certain size.
*
* @param[in] mail_q pointer to the handler of the mail queue.
* @param[in] mail_cnt mail count of the mail queue.
* @param[in] mail_size size of each mail in the mail queue.
*
* @return errcode
* @retval #K_ERR_NONE return successfully.
*/
__API__ k_err_t tos_mail_q_create_dyn(k_mail_q_t *mail_q, size_t mail_cnt, size_t mail_size);
/**
* @brief Destroy a mail queue with dynamic allocated pool.
* destroy a mail queue with dynamic allocated pool.
*
* @attention None
*
* @param[in] mail_q pointer to the handler of the mail queue.
*
* @return errcode
* @retval #K_ERR_NONE return successfully.
*/
__API__ k_err_t tos_mail_q_destroy_dyn(k_mail_q_t *mail_q);
#endif
/**
* @brief Flush the mail queue.
* flush the mail queue.