Skip to main content
Knowledgebase
Home
Renesas India - Knowledgebase

How do I use Queues with Half Word Values?

Last Updated:05/09/2017

Overview

Explains how to use ThreadX Queues with half word values.

Goal

After completing this how-to you will be able to use ThreadX queues with half word values.

Prerequisites

You need to have a project that uses a ThreadX Queue.

Setup

Go to the area of your code where you use the tx_queue_send or tx_queue_receive API. Use a construct to create a word value. For example: uint16_t testValue[2] = {1234, 0}; You can then use a pointer to testValue in the API. For example:  tx_queue_send(&g_console_queue, &testValue, TX_NO_WAIT);
 
It is best however to just use word values. This also helps insure messages are aligned on a word boundary, which is required.

What's Next

You should now be able to correctly use messages for ThreadX queue APIs.