Index: App/Services/MsgQueues.h =================================================================== diff -u -ree310a2e5262c05bf0dc0eb0d84da0ee50bac7fe -r833095dbbe2b21a989b05f48bd7ddc390ad964cb --- App/Services/MsgQueues.h (.../MsgQueues.h) (revision ee310a2e5262c05bf0dc0eb0d84da0ee50bac7fe) +++ App/Services/MsgQueues.h (.../MsgQueues.h) (revision 833095dbbe2b21a989b05f48bd7ddc390ad964cb) @@ -21,26 +21,16 @@ // ********** public definitions ********** -#define MAX_MSG_QUEUE_SIZE 25 // bytes -#define MAX_MSG_CARGO_SIZE 255 // bytes +#define MAX_MSG_CARGO_SIZE 100 // bytes typedef enum Msg_Queues { - MSG_Q_CAN_HD_ALARM = 0, - MSG_Q_CAN_DG_ALARM, - MSG_Q_CAN_UI_ALARM, - MSG_Q_CAN_HD_2_DG, - MSG_Q_CAN_DG_2_HD, - MSG_Q_CAN_HD_2_UI, - MSG_Q_CAN_HD_BROADCAST, - MSG_Q_CAN_DG_BROADCAST, - MSG_Q_CAN_UI_2_HD, - MSG_Q_CAN_UI_BROADCAST, - MSG_Q_DBG_IN, - MSG_Q_DBG_OUT, + MSG_Q_IN_CAN = 0, + MSG_Q_IN_DBG, NUM_OF_MSG_QUEUES } MSG_QUEUE_T; +#pragma pack(push,1) typedef struct { U16 msgID; // ID of message @@ -58,13 +48,18 @@ MESSAGE_T msg; // message U08 crc; // message CRC } MESSAGE_WRAPPER_T; +#pragma pack(pop) +#define MESSAGE_OVERHEAD_SIZE (sizeof(MESSAGE_HEADER_T) + sizeof(U08)) + // ********** public function prototypes ********** void initMsgQueues( void ); -BOOL addToMsgQueue( MSG_QUEUE_T queue, MESSAGE_T *msg ); -BOOL getFromMsgQueue( MSG_QUEUE_T queue, MESSAGE_T *msg ); +BOOL addToMsgQueue( MSG_QUEUE_T queue, MESSAGE_WRAPPER_T *msg ); +BOOL getFromMsgQueue( MSG_QUEUE_T queue, MESSAGE_WRAPPER_T *msg ); BOOL isMsgQueueEmpty( MSG_QUEUE_T queue ); BOOL isMsgQueueFull( MSG_QUEUE_T queue ); +void blankMessage( MESSAGE_T *message ); +void blankMessageInWrapper( MESSAGE_WRAPPER_T *message ); #endif