2017-04-03 7 views
1

ADC를 통해 MSP430F5529 포트에서 CC3100을 사용하여 액세스 포인트로 읽은 일부 센서 값을 보내려고합니다. 나는 getting_started_with_wlan_station 예제를 CC3100SDK_1.2.0에서 가져 와서 slac300i에서 MSP430F55xx_adc_01.c 코드를 추가했습니다. 이 기능은TI CC3100 getting_started_with_wlan_station 예제 링커 오류가 발생했습니다

static void read_adc(void){ 
    ADC12CTL0 = ADC12SHT02 + ADC12ON;   // Sampling time, ADC12 on 
    ADC12CTL1 = ADC12SHP;      // Use sampling timer 
    ADC12IE = 0x01;       // Enable interrupt 
    ADC12CTL0 |= ADC12ENC; 
    P6SEL |= 0x01;       // P6.0 ADC option select 
    P1DIR |= 0x01;       // P1.0 output 
} 

이 주요 기능은 프로젝트를 빌드에

read_adc(); 
while(1){ 
    /* Read ADC values*/ 
    ADC12CTL0 |= ADC12SC;     // Start sampling/conversion 
    adc_values = ADC12MEM0 & 0x0FFF; // keep only low 12 bits 
    CLI_Write((_u8 *) adc_values); 
    CLI_Write((_u8 *)"\n"); 
    __bis_SR_register(LPM0_bits + GIE);  // LPM0, ADC12_ISR will force exit 
    __no_operation();      // For debugger 
} 

을 가지고, 링커 오류

<Linking> 
error #10056: symbol "__TI_int54" redefined: first defined in "./main.obj"; redefined in "./board/board.obj" 
error #10010: errors encountered during linking; "getting_started_with_wlan_station.out" not built 

>> Compilation failure 
makefile:165: recipe for target 'getting_started_with_wlan_station.out' failed 
gmake: *** [getting_started_with_wlan_station.out] Error 1 
gmake: Target 'all' not remade because of errors. 
에게가있는 ADC를 구성 : 여기

는 같은 모습입니다

코드에 다음 섹션을 추가했기 때문에이 오류가 표시됩니다. 나는이 주석 경우 채널은 또한,

#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) 
#pragma vector = ADC12_VECTOR 
__interrupt void ADC12_ISR(void) 
#elif defined(__GNUC__) 
void __attribute__ ((interrupt(ADC12_VECTOR))) ADC12_ISR (void) 
#else 
#error Compiler not supported! 
#endif 
{ 
    switch(__even_in_range(ADC12IV,34)) 
    { 
    case 0: break;       // Vector 0: No interrupt 
    case 2: break;       // Vector 2: ADC overflow 
    case 4: break;       // Vector 4: ADC timing overflow 
    case 6:         // Vector 6: ADC12IFG0 
     if (ADC12MEM0 >= 0x7ff)     // ADC12MEM = A0 > 0.5AVcc? 
      P1OUT |= BIT0;      // P1.0 = 1 
     else 
      P1OUT &= ~BIT0;      // P1.0 = 0 

     __bic_SR_register_on_exit(LPM0_bits); // Exit active CPU 
    case 8: break;       // Vector 8: ADC12IFG1 
    case 10: break;       // Vector 10: ADC12IFG2 
    case 12: break;       // Vector 12: ADC12IFG3 
    case 14: break;       // Vector 14: ADC12IFG4 
    case 16: break;       // Vector 16: ADC12IFG5 
    case 18: break;       // Vector 18: ADC12IFG6 
    case 20: break;       // Vector 20: ADC12IFG7 
    case 22: break;       // Vector 22: ADC12IFG8 
    case 24: break;       // Vector 24: ADC12IFG9 
    case 26: break;       // Vector 26: ADC12IFG10 
    case 28: break;       // Vector 28: ADC12IFG11 
    case 30: break;       // Vector 30: ADC12IFG12 
    case 32: break;       // Vector 32: ADC12IFG13 
    case 34: break;       // Vector 34: ADC12IFG14 
    default: break; 
    } 
} 

그러나 slac300i에서 가져, 디버거는 프로젝트

/* Catch interrupt vectors that are not initialized. */ 
#ifdef __CCS__ 
#pragma vector=WDT_VECTOR, ADC12_VECTOR, USCI_B1_VECTOR, \ 
    TIMER1_A1_VECTOR, TIMER0_A1_VECTOR, \ 
    TIMER2_A1_VECTOR, COMP_B_VECTOR, USB_UBM_VECTOR, UNMI_VECTOR,DMA_VECTOR, \ 
    TIMER0_B0_VECTOR, TIMER0_B1_VECTOR,SYSNMI_VECTOR, USCI_B0_VECTOR, RTC_VECTOR 
__interrupt void Trap_ISR(void) 
{ 
    while(1); 
} 

에, board.c 파일의 다음 섹션에서 무한 루프에 존재 걸리면 인터럽트 초기화시 누락 된 부분을 제안하십시오. 문제가되는 것 같습니다. 아니면 다른 것을 놓치고 있습니까?

답변

0

__TI_int54은 ADC12 인터럽트 처리기의 주소가 저장되는 메모리 워드입니다.

동일한 인터럽트에 대해 두 개의 인터럽트 핸들러, ADC12_ISR()Trap_ISR()을 정의하려고합니다. 후자는 실제 핸들러가 존재하지 않는 인터럽트를 잡기위한 것이기 때문에 목록에서 ADC12_VECTOR을 제거해야합니다.

+0

고맙습니다. 이것은 효과가있다! – Deepak

관련 문제