Download bits pot yellow User..
Transcript
AN07-00200-03E
Finally,about the processes according to the ID received, there is a vBaseTimeTask function around
the 100th line of the main routine. This function is called periodically at set cycles, and mainly
checks whether or not sending and receiving has finished. If this function is called when all data has
finished being sent (i.e., when flagsLinTxRx.bit.SucceedReception has been set), the submain
function is called as the reception completion processing as shown in “Figure 5-21 Submain
processing”, and temperature measurement processing, buzzer output processing, LED ON
processing, and sent data storage are performed.
void
submain(void)
{
switch (ucCurrentId.fields.id){
ID: 0x00
case 0x00
if (ucDATA00[0] == 0x55){
IO_ADC2.byte = 0xCB;
IO_ADC1.byte = 0x71;
Start AD interrupt
(obtain temperature information)
if(ad_master < 42){
IO_PDR1.byte = LED_pat2[1];
Temperature information LED display
(Omitted)
case 0x02
IO_ADC2.byte = 0xCB;
IO_ADC1.byte = 0x11;
Start AD interrupt (obtain VR information)
IO_PC00.byte = 0x0E;
Buzzer output
(Omitted)
case 0x04
if ((ucDATA04[0] == 0x55)&&(ucDATA04[3] != 0xFF)){
(Omitted)
Received LED value ON processing
else if (LED_count_Flag == 1){
If switch 2 is pressed
(Omitted)
ucDATA05[3] = LED_count1; LED value stored after count increases
else if (LED_count_Flag == 2){
If switch 3 is pressed
(Omitted)
ucDATA05[3] = LED_count1; LED value stored after count decreases
default:
break;
Figure 5-21 Submain processing
108