Queue

 

Messages queue


Queue is used mainly to echange data between threads .

1.Message queue create

To create queue we will use tx_queue_create. First argument is queue handle queue_ptr. Second argument is name os queue my_queue. Third argument is queue message size 1-16words. In out case 1. Forth argument is queue buffer queue_stack. Fifth argument is queue buffer size in bytes 1000.






2.Message queue send

To add message to queue we use function tx_queue_send. First argument is queue handle queue_ptr. Second argument is pointer to messagge message. Third argument is waiting time TXNOWAIT (0x0) to TXWAITFOREVER(0xFFFFFFFF).


3.Message queue receive

To remove message from queue we use function tx_queue_receive First argument is queue handle queue_ptr. Second argument is pointer to messagge message. Third argument is waiting time TXNOWAIT (0x0) to TXWAITFOREVER(0xFFFFFFFF).





4. example

Commentaires

Posts les plus consultés de ce blog

Azure RTOS with Stm32

AZURE-RTOS ThreadX in the STM32Cube ecosystem

STM32F7_HAL_ETH_MQTT_CLIENT