From c5fe9fb425693108ff358f3e82774bc725184612 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 18 Feb 2014 14:14:51 -0600 Subject: [PATCH] Use uint16_t vs uint8_t in the message queue structure if the max message size is > 128 --- include/nuttx/mqueue.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/nuttx/mqueue.h b/include/nuttx/mqueue.h index 43c0aab6e0..27961717b6 100644 --- a/include/nuttx/mqueue.h +++ b/include/nuttx/mqueue.h @@ -73,7 +73,11 @@ struct msgq_s int16_t nconnect; /* Number of connections to message queue */ int16_t nwaitnotfull; /* Number tasks waiting for not full */ int16_t nwaitnotempty; /* Number tasks waiting for not empty */ +#if CONFIG_MQ_MAXMSGSIZE < 256 uint8_t maxmsgsize; /* Max size of message in message queue */ +#else + uint16_t maxmsgsize; /* Max size of message in message queue */ +#endif bool unlinked; /* true if the msg queue has been unlinked */ #ifndef CONFIG_DISABLE_SIGNALS FAR struct mq_des *ntmqdes; /* Notification: Owning mqdes (NULL if none) */