www.pudn.com > CAN.rar > 更改方案1.txt, change:2010-05-15,size:2532b


while(1) 
  {  
       if(Xflag==0) 
       { 
            if(GpReFrameBuf->ucSize > 0) 
            { 
                while(canReadByteBuf(GpReFrameBuf,&tCanFrame)!=EMPTY) 
                { 
                    GbCANTI=false; 
                    canFrameSend(GpCanNodeInfo,&tCanFrame); 
                    while(GbCANTI!=true) 
                    { 
                        delay(10 * (GulSysClock / 4000)); 
                    } 
                } 
                Xflag=1; 
                break; 
            }  
            else 
            { 
                canWriteByteBuf(GpTxFrameBuf,&GtCanFrameTest); 
                canWriteByteBuf(GpTxFrameBuf,&GtCanFrameTime); 
                if(GpTxFrameBuf->ucSize > 0)  
                {                               
                    while (canReadByteBuf(GpTxFrameBuf, &tCanFrame) != EMPTY) 
                    {        
                        GbCANTI = false;//CAN发送中断标志  
                        canFrameSend(GpCanNodeInfo, &tCanFrame); 
       //                 break; 
                    } 
               
                    while (GbCANTI != true) 
                    { 
                        delay(10 * (GulSysClock / 4000));                   
                    }                 
                 
                    canMsgObjSet(GpCanNodeInfo, 0x01, MASK, EXT_ID_FILTER, MSG_OBJ_TYPE_RX_REMOTE);                                                                                         
                } 
            }   
       } 
       else 
       { 
       
            canWriteByteBuf(GpReFrameBuf,&GtCanFrameX); 
            canWriteByteBuf(GpReFrameBuf,&GtCanFrameY); 
            if(GpReFrameBuf->ucSize > 0)  
            {                               
                while (canReadByteBuf(GpReFrameBuf, &tCanFrame) != EMPTY) 
                {        
                    GbCANTI = false;//CAN发送中断标志  
                    canFrameSend(GpCanNodeInfo, &tCanFrame); 
                    delay(10 * (GulSysClock / 4000)); 
             //     break; 
                } 
               
                while (GbCANTI != true) 
                { 
                    delay(10 * (GulSysClock / 4000));                   
                }                 
                canMsgObjSet(GpCanNodeInfo, 0x01, MASK, EXT_ID_FILTER, MSG_OBJ_TYPE_RX_REMOTE);                                                                                         
            } 
       } 
            delay(10 * (GulSysClock / 4000)); 
    } 
   
}