add ring queue/message queue/mail queue, binary heap/priority queue/priority message queue/priority mail queue
1. remove the old msg queue and queue: i. msg queue is not a common and reusable/flexible component(need user to config the msg pool size and this componet can only be used by tos_queue) ii. tos_queue can only deliver the pointer message(cannot do a memory buffer deliver) 2. add ring queue(tos_ring_q) componet rinq queue can be reused by tos_chr_fifi/tos_msg_q/tos_mail_q as the foundational data container 3. add message queue(tos_msg_q) a little like the old queue mechanism, supply the capability to deliver a pointer message 4. add mail queue(tos_mail_q) supply the capability to deliver a memory buffer 5. add binary heap(tos_bin_heap) the basement componet to implement priority queue 6. add priority queue(tos_prio_q) can be reused by the priority message/mail queue as the foundational data container. 7. add priority message queue(tos_prio_msg_q) a message(pointer) deliver mechanism, supply the capability of delivering the message with priority(message with higher priority comes faster to the pender than with lower) 8. add priority mail queue(tos_prio_mail_q) a mail(memory buffer) deliver mechanism, supply the capability of delivering the mail with priority(mail with higher priority comes faster to the pender than with lower)
This commit is contained in:
@@ -74,7 +74,7 @@ typedef enum at_channel_status_en {
|
||||
|
||||
typedef struct at_data_channel_st {
|
||||
uint8_t is_free;
|
||||
k_fifo_t rx_fifo;
|
||||
k_chr_fifo_t rx_fifo;
|
||||
uint8_t *rx_fifo_buffer;
|
||||
k_mutex_t rx_lock;
|
||||
|
||||
@@ -105,27 +105,27 @@ typedef struct at_event_st {
|
||||
typedef struct at_agent_st {
|
||||
at_data_channel_t data_channel[AT_DATA_CHANNEL_NUM];
|
||||
|
||||
at_event_t *event_table;
|
||||
size_t event_table_size;
|
||||
at_event_t *event_table;
|
||||
size_t event_table_size;
|
||||
|
||||
at_echo_t *echo;
|
||||
at_echo_t *echo;
|
||||
|
||||
k_task_t parser;
|
||||
at_cache_t recv_cache;
|
||||
k_task_t parser;
|
||||
at_cache_t recv_cache;
|
||||
|
||||
at_timer_t timer;
|
||||
at_timer_t timer;
|
||||
|
||||
k_mutex_t global_lock;
|
||||
k_mutex_t global_lock;
|
||||
|
||||
char *cmd_buf;
|
||||
k_mutex_t cmd_buf_lock;
|
||||
char *cmd_buf;
|
||||
k_mutex_t cmd_buf_lock;
|
||||
|
||||
hal_uart_t uart;
|
||||
k_mutex_t uart_tx_lock;
|
||||
k_mutex_t uart_rx_lock;
|
||||
k_sem_t uart_rx_sem;
|
||||
k_fifo_t uart_rx_fifo;
|
||||
uint8_t *uart_rx_fifo_buffer;
|
||||
hal_uart_t uart;
|
||||
k_mutex_t uart_tx_lock;
|
||||
k_mutex_t uart_rx_lock;
|
||||
k_sem_t uart_rx_sem;
|
||||
k_chr_fifo_t uart_rx_fifo;
|
||||
uint8_t *uart_rx_fifo_buffer;
|
||||
} at_agent_t;
|
||||
|
||||
#define AT_AGENT ((at_agent_t *)(&at_agent))
|
||||
|
Reference in New Issue
Block a user