- void CAN_TRA(u8t *pRegValue)
- {
- while(TXB0REQ);
- TXB0REQ = 0;
- TXB0D0 = *pRegValue;
- TXB0D1 = *(pRegValue+1);
- TXB0D2 = *(pRegValue+2);
- TXB0D3 = *(pRegValue+3);
- TXB0D4 = *(pRegValue+4);
- TXB0D5 = *(pRegValue+5);
- TXB0D6 = *(pRegValue+6);
- TXB0D7 = *(pRegValue+7);
- TXB0REQ = 1;
- while( TXB0REQ == 1 );
- }
我自己的发送函数供楼主参考
TXB0IF置位代表什么LZ仔细看一下手册
TXB0IF: CAN Transmit Buffer 0 Interrupt Flag bit
1 = Transmit Buffer 0 has completed transmission of a message and may be reloaded
0 = Transmit Buffer 0 has not completed transmission of a message
|