|
interrupt void SCIRXINTB_ISR(void) // SCI-B
{
int i,j;
Uint16 scib_rx_buf[10];
SCIB_RX_BUF[RxLen++] = (ScibRegs.SCIRXBUF.all)&0x04;
for(j=0;j<8;j++)
{
scib_rx_buf[j] = ScibRegs.SCIRXBUF.all;
if(j<7)
{
SCIB_RX_BUF[RxLen++]= scib_rx_buf[j];
scib_rx_buf[j]=0;
}
}
Modbus_scan(); //modbus算法
delay_int();
for(j=0;j
{
ScibRegs.SCITXBUF = SCIB_TX_BUF[j];
while(ScibRegs.SCICTL2.bit.TXRDY!=1);
}
TxLen=0;
delay_int();
ScibRegs.SCIFFTX.bit.SCIRST=0;
delay_int();
ScibRegs.SCIFFTX.bit.SCIRST=1;
ScibRegs.SCIFFRX.bit.RXOVF_CLR = 1;
ScibRegs.SCIFFRX.bit.RXFFINTCLR = 1;
PieCtrlRegs.PIEACK.all = 0x0100; //响应中断
GpioDataRegs.GPADAT.bit.GPIOA6 = 0; //选通串口接收功能
for(i=0;i<10;i++)
delay_int();
RxLen=0;
}
这是我的中断程序 |
|