Finally,about the processes according to the ID received, there is a vBaseTimeTask function around
th
the 100
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){
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)){
else if (LED_count_Flag == 1){
else if (LED_count_Flag == 2){
default:
ID: 0x00
Start AD interrupt
Start AD interrupt (obtain VR information)
Buzzer output
Received LED value ON processing
(Omitted)
(Omitted)
ucDATA05[3] = LED_count1;
(Omitted)
ucDATA05[3] = LED_count1;
break;
Figure 5-21 Submain processing
108
(obtain temperature information)
Temperature information LED display
If switch 2 is pressed
LED value stored after count increases
If switch 3 is pressed
LED value stored after count decreases
AN07-00200-03E