|
最近得到一段这样的程序,请高手指点一下它的功能:加上注释就好了
interrupt [TIMERA0_VECTOR] void Timer_A(void)
{ float i,j;
PidIntNo++;
if(PidIntNo>25){PidEn=1;PidIntNo=0;}
KeyLedIntNo++;
if(KeyLedIntNo>10){KeyLedEn=1;KeyLedIntNo=0;}
CountIntNo++;
// if(CountIntNo>(3000/Count)){CountEn=1;CountIntNo=0;}
ADC12CTL0 &=~ENC;//stop repeat conversion
TempA_Sampling[7]=TempA_Sampling[6];
TempA_Sampling[6]=TempA_Sampling[5];
TempA_Sampling[5]=TempA_Sampling[4];
TempA_Sampling[4]=TempA_Sampling[3];
TempA_Sampling[3]=TempA_Sampling[2];
TempA_Sampling[2]=TempA_Sampling[1];
TempA_Sampling[1]=TempA_Sampling[0];
TempA_Sampling[0]=ADC12MEM0;
TempB_Sampling[0]=ADC12MEM2;
TempB_Sampling[7]=TempB_Sampling[6];
TempB_Sampling[6]=TempB_Sampling[5];
TempB_Sampling[5]=TempB_Sampling[4];
TempB_Sampling[4]=TempB_Sampling[3];
TempB_Sampling[3]=TempB_Sampling[2];
TempB_Sampling[2]=TempB_Sampling[1];
TempB_Sampling[1]=TempB_Sampling[0];
i=(TempA_Sampling[0]+TempA_Sampling[1]+TempA_Sampling[2]+TempA_Sampling[3]
+TempA_Sampling[4]+TempA_Sampling[5]+TempA_Sampling[6]+TempA_Sampling[7])/8.0;
j=(TempB_Sampling[0]+TempB_Sampling[1]+TempB_Sampling[2]+TempB_Sampling[3]
+TempB_Sampling[4]+TempB_Sampling[5]+TempB_Sampling[6]+TempB_Sampling[7])/8.0;
TempA_Real=50.403*(0.00061035*i-0.496);
TempB_Real=50.403*(0.00061035*j-0.496);
ADC12CTL0 |=0x0002;//ena××e conversion
ADC12CTL0 |=0x0001;//start conversion
}
|
|