Revision 5766017b
core/src/aos_rtcan.c | ||
---|---|---|
25 | 25 |
|
26 | 26 |
#define True 1 |
27 | 27 |
#define False 0 |
28 |
#define NRT 1111111 |
|
29 |
#define HRT 0000000 |
|
30 | 28 |
|
31 | 29 |
/* |
32 | 30 |
* @brief transmit Message over CAN |
... | ... | |
64 | 62 |
if(msgqueueEmpty(msgqueue)){ |
65 | 63 |
msgqueue->head = msg; |
66 | 64 |
msgqueue->tail= msg; |
67 |
msg->next = msg;
|
|
65 |
msg->next = NULL;
|
|
68 | 66 |
return; |
69 | 67 |
} |
70 | 68 |
//todo special case handling |
... | ... | |
75 | 73 |
}; |
76 | 74 |
} |
77 | 75 |
msgqueue->tail->next = msg; |
78 |
msg->next = msg;
|
|
76 |
msg->next = NULL;
|
|
79 | 77 |
msgqueue->tail = msg; |
80 | 78 |
msgqueue->size++; |
81 | 79 |
} |
... | ... | |
87 | 85 |
*/ |
88 | 86 |
rtcan_msg_t* popRTCanMsg(msgqueue_t* msgqueue){ |
89 | 87 |
if(!msgqueueEmpty(msgqueue)){ |
90 |
return msgqueue->head; |
|
88 |
rtcan_msg_t elem = msgqueue->head; |
|
89 |
msgqueue->head = elem->next; |
|
90 |
return elem; |
|
91 | 91 |
} |
92 | 92 |
return NULL; |
93 | 93 |
} |
Also available in: Unified diff