summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorFrédéric Desbiens <[email protected]>2025-04-15 08:46:53 -0400
committerGitHub <[email protected]>2025-04-15 08:46:53 -0400
commit4fdc5dc0aea77e29118ef9873996d7733beb1309 (patch)
treea3bf569b0c006f5b158bebbc8209639cf0d2e8dd /common
parent7ad78c40e9702917264a9b722890110fdb909ebc (diff)
parent87e511034647af30cf96be09149cbaf707be63a2 (diff)
Merge pull request #447 from eclipse-threadx/implement_new_feature_424
Make queue max message size configurable
Diffstat (limited to 'common')
-rw-r--r--common/inc/tx_api.h6
-rw-r--r--common/inc/tx_user_sample.h7
-rw-r--r--common/src/txe_queue_create.c4
3 files changed, 15 insertions, 2 deletions
diff --git a/common/inc/tx_api.h b/common/inc/tx_api.h
index 3ff05f4b..77be2efd 100644
--- a/common/inc/tx_api.h
+++ b/common/inc/tx_api.h
@@ -328,6 +328,12 @@ extern "C" {
#define TX_TIMER_TICKS_PER_SECOND (100UL)
#endif
+/* Define the default maximum message size in a queue. The default value is TX_16_ULONG, but may
+ be customized in tx_user.h or as a compilation option. */
+
+#ifndef TX_QUEUE_MESSAGE_MAX_SIZE
+#define TX_QUEUE_MESSAGE_MAX_SIZE TX_16_ULONG
+#endif
/* Event numbers 0 through 4095 are reserved by Azure RTOS. Specific event assignments are:
diff --git a/common/inc/tx_user_sample.h b/common/inc/tx_user_sample.h
index e7ecb56a..f8d809b5 100644
--- a/common/inc/tx_user_sample.h
+++ b/common/inc/tx_user_sample.h
@@ -117,6 +117,13 @@
#define TX_TIMER_THREAD_PRIORITY ????
*/
+/* Define the maximum size of a message in the a queue. the Default value is TX_ULONG_16.
+ the new value must be a multiple of ULONG. */
+
+/*
+#define TX_QUEUE_MESSAGE_MAX_SIZE TX_ULONG_16
+*/
+
/* Define the common timer tick reference for use by other middleware components. The default
value is 10ms (i.e. 100 ticks, defined in tx_api.h), but may be replaced by a port-specific
version in tx_port.h or here.
diff --git a/common/src/txe_queue_create.c b/common/src/txe_queue_create.c
index 68d3540a..2d91cc9f 100644
--- a/common/src/txe_queue_create.c
+++ b/common/src/txe_queue_create.c
@@ -178,8 +178,8 @@ TX_THREAD *thread_ptr;
status = TX_SIZE_ERROR;
}
- /* Check for an invalid message size - greater than 16. */
- else if (message_size > TX_16_ULONG)
+ /* Check for an invalid message size - greater than TX_QUEUE_MESSAGE_MAX_SIZE 16 by default. */
+ else if (message_size > TX_QUEUE_MESSAGE_MAX_SIZE)
{
/* Invalid message size specified. */