volatile Uint32 RunF;
volatile Uint16 Duty;
volatile Uint16 ADC_U_out;
volatile int16 Phase_erro;
interrupt void adc_isr(void)
{
static volatile Uint16 temp16,cnt=0;
LedOn;LedOff;
ADC_U_out= AdcResult.ADCRESULT0;
if( ADC_U_out>512 )
{
if(Duty>10) Duty--;
}
else
{
if(Duty<100) Duty++;
}
volatile Uint16 ADC_U_out; 必须要要用 volatile ,否则运行出错。 这是为什么?