Revision 2538f3de

View differences:

core/src/aos_rtcan.c
143 143
static msg_t Thread(void *arg){
144 144
  (void)arg;
145 145
  chRegSetThreadName("RTCAN Timer");
146
  int nextSlot; // set by while loop from calendar
146 147

  
147 148
  while (true){
149
    // iterate over calendar(bitmask)
150
    rtcan_msg_t *nextMsg;
148 151
    chThdSleepMilliseconds( 20 );
152
    if(nextSlot == 1){
153
      nextMsg = popRTCanMsg(&hrtQueue);
154
    }else{
155
      if(!msgqueueEmpty(srtQueue)){
156
        nextMsg = popRTCanMsg(&srtQueue);
157
      }else{
158
        nextMsg = popRTCanMsg(&nrtQueue);
159
      }
160
    }
149 161
    // Take next element from queue
162
    // create frame
150 163
    // place it in buffer to be sent in next time slot
151 164
    chThdSleepMilliseconds( 20 );
152 165
  }

Also available in: Unified diff