?? linserviceroutinetemplate.c
字號:
#include "TJA1020.h"
#include "LinCmpSl.h"
#include "Relpc764.h"
char* data LinDataPtr;
//only for example
char aktTemp;
void LinServiceRoutine()
{
//**do not delete**
asm{0xC0, 0xD0}; //Push PSW
asm{0xC0, 0xE0}; //Push ACC
asm{0xC0, 0x00}; //Push AR0
//*****************
if (LinError==0) //Test if LinError is '0'
{
if (LinFrameOk)
{
//process here all IDs, the node should receive
//e.g.
if (LinID==0x14)
aktTemp=LinDataPtr[0];
}
else if (LinIDreceived)
{
//process here all IDs, the node should send
//e.g.
if (LinID==0x10)
{
LinDataPtr[0]=0x08;
TI=1;
}
else if (LinID==0x11)
{
LinDataPtr[0]=0x15;
TI=1;
}
else if (LinID==0x12)
{
LinDataPtr[0]=0x47;
TI=1;
}
else if (LinID==0x13)
{
LinDataPtr[0]=0x11;
TI=1;
}
}
}
else
{
//process here the reaction on a Lin error
LinError=0;
}
//**do not delete**
asm{0xD0, 0x00}; //Push AR0
asm{0xD0, 0xE0}; //Push ACC
asm{0xD0, 0xD0}; //Push PSW
//*****************
return;
}
void main()
{
LinDataPtr=&LinData;
InitTranceiver();
InitLinMac();
while(1){};
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -