我用msp430f449开发系统附的光盘里IAR_3.40A C程序中ADC12的程序怎么通不过编译啊???代码如下: #include "msp430x44x.h" // Standard Equations
static unsigned int results; // Needs to be global in this example // Otherwise, the compiler removes it // because it is not used for anything.
void main(void) { WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer P6SEL |= 0x01; // Enable A/D channel A0 ADC12CTL0 = ADC12ON+SHT0_15; // Turn on ADC12, ADC12CTL1 = SHP; // Use sampling timer, ADC12IE = 0x01; // Enable ADC12IFG.0 ADC12CTL0 |= ENC; // Enable conversions _EINT(); // Enable interrupts
while(1) { ADC12CTL0 |= ADC12SC; // Start conversion _BIS_SR(LPM0_bits); // Enter LPM0 } }
interrupt[ADC_VECTOR] void ADC12ISR (void) { results = ADC12MEM0; // Move results, _BIC_SR_IRQ(LPM0_bits); // } 编译报错: Pe077:this declaration has no storage class or type specifier Pe065:expected a “;” 把中断换成 #pragma vector = ADC_VECTOR _interrupt void ADC_Interrupt(void) //interrupt[ADC_VECTOR] void ADC12ISR (void) { results = ADC12MEM0; // Move results, _BIC_SR_IRQ(LPM0_bits); // Clear LPM0, } 还是不行,报同样的错。 哪位知道的请帮个忙啊,感激涕零 |