
AN07-00200-03E
108
Finally,about the processes according to the ID received, there is a vBaseTimeTask function around
the 100
th
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.
Figure 5-21 Submain processing
void
submain(void)
{
switch (ucCurrentId.fields.id){
case
0x00
if (ucDATA00[0] == 0x55){
IO_ADC2.byte = 0xCB;
IO_ADC1.byte = 0x71;
if(ad_master < 42){
IO_PDR1.byte = LED_pat2[1];
(Omitted)
case
0x02
IO_ADC2.byte = 0xCB;
IO_ADC1.byte = 0x11;
IO_PC00.byte = 0x0E;
(Omitted)
case 0x04
if ((ucDATA04[0] == 0x55)&&(ucDATA04[3] != 0xFF)){
(Omitted)
else if (LED_count_Flag == 1){
(Omitted)
ucDATA05[3] = LED_count1;
else if (LED_count_Flag == 2){
(Omitted)
ucDATA05[3] = LED_count1;
default:
break;
ID: 0x00
Start AD interrupt
(obtain temperature information)
Temperature information LED display
Start AD interrupt (obtain VR information)
Buzzer output
Received LED value ON processing
If switch 2 is pressed
If switch 3 is pressed
LED value stored after count increases
LED value stored after count decreases