mirror of
https://github.com/eclipse-threadx/threadx.git
synced 2025-11-16 04:24:48 +00:00
Make queue max message size configurable
Summary ------- This commit fixes the issue #424 Details -------- - Add a the configuration option TX_QUEUE_MESSAGE_MAX_SIZE in the tx_api.h with default value set to TX_ULONG_16 to keep backword compatibility. - Update the txe_queue_create() to check on TX_QUEUE_MESSAGE_MAX_SIZE rather than TX_ULONG_16 as max message size. - Add a new unitary test to cover the new change.
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user