***********************************************************************************************************************/
#pragma vector = INTLR_vect
__interrupt static void LIN_Slave_interrupt_receive(void)
{
uint16_t header_receive_flag;
uint16_t buffer_receive_flag;
uint8_t PID;
header_receive_flag = UF0STR & 0x0800;
buffer_receive_flag = UF0STR & 0x0400;
if(header_receive_flag != 0)
{
UF0STC |= 0x0800; /* clear UF0HDC*/
PID = UF0ID;
switch (PID)
{
case 0x08 : LIN_Slave_Receive(3);
break;
case 0x49 : LIN_Slave_Receive(3);
break;
case 0xCA : LIN_Slave_Receive(3);
break;
case 0x8B : LIN_Slave_Transmit(Slave_TxData, 2);
LED1=OFF;
LED2=OFF;
break;
default: break;
}
}
if(buffer_receive_flag != 0)
{
PID = UF0ID;
switch (PID)
{
case 0x08 : P7 = Get_response_RxData(Slave_RxData1);
break;
case 0x49 : P7 = Get_response_RxData(Slave_RxData2);
break;
case 0xca : P7 = Get_response_RxData(Slave_RxData3);
break;
default: LIN_Slave_NoResponse();
break;
}
UF0STC |= 0x0400; /*Clear UF0BUC*/
}
}
在线求高手解析 |