Revision b85b6b26

View differences:

core/src/aos_rtcan.c
87 87
void pushRTCanMsg(rtcan_msg_t *msg,msgqueue_t* msgqueue){
88 88
  if(msg != NULL){
89 89
    if(msgqueueEmpty(msgqueue)){
90
        msgqueue->head = msg;
91
        msgqueue->tail= msg;
92
        msg->next = NULL;
90
        queueInit(msg,msgqueue);
93 91
        return;
94 92
    }
95 93
    //todo special case handling
96 94
    if(msgqueue->tail != NULL){
97 95
      if(msg->msgType == 10){
98
          if(pushRTCanMsgSorted(msg,msgqueue) == true){
99
              return;
100
          };
96
        if(pushRTCanMsgSorted(msg,msgqueue) == true){
97
            return;
98
        }
101 99
      }
102 100
      msgqueue->tail->next = msg;
103 101
      msg->next = NULL;
......
122 120
/*
123 121
 * @brief init Message Queue
124 122
 */
125
void queueInit(rtcan_msg_t *head){
126
  head->next = head;
123
void queueInit(rtcan_msg_t *head,msgqueue_t* msgqueue){
124
  msgqueue->size = 0;
125
  msgqueue->head = head;
126
  msgqueue->tail = head;
127
  head->next = NULL;
128
  msgqueue->size++;
127 129
}
128 130

  
129 131
/**

Also available in: Unified diff