cortex m3 관련 구조는 너무 달라서 이리저리 헤매는 중 ㅠ.ㅠ
stellarisware 데모 코드들을 뜯어보고 이리저리 보니
avr이 아래와 같이 ISR() 식으로 정해진 코드로 한다고 한다면
| #include <avr/interrupt.h> ISR(ADC_vect) 
{ 
    // user code here 
}  
 | 
arm ti cortex m3 는 초기화 코드중 isr_vector 섹션에 들어갈 변수에 함수 포인터를 등록해주는 식으로 구성된다.
말을 쉽게 하자면, 원하는 함수 명으로 대충 void func(void) 식으로 만들고 등록만 해주면 땡~
| __attribute__ ((section(".isr_vector"))) 
void (* const g_pfnVectors[])(void) = 
{ 
    (void (*)(void))((unsigned long)pulStack + sizeof(pulStack)), 
                                            // The initial stack pointer 
    ResetISR,                               // The reset handler 
    NmiSR,                                  // The NMI handler 
    FaultISR,                               // The hard fault handler 
    IntDefaultHandler,                      // The MPU fault handler 
    IntDefaultHandler,                      // The bus fault handler 
    IntDefaultHandler,                      // The usage fault handler 
    0,                                      // Reserved 
    0,                                      // Reserved 
    0,                                      // Reserved 
    0,                                      // Reserved 
    IntDefaultHandler,                      // SVCall handler 
    IntDefaultHandler,                      // Debug monitor handler 
    0,                                      // Reserved 
    IntDefaultHandler,                      // The PendSV handler 
    IntDefaultHandler,                      // The SysTick handler 
    IntDefaultHandler,                      // GPIO Port A 
    IntDefaultHandler,                      // GPIO Port B 
    IntDefaultHandler,                      // GPIO Port C 
    IntDefaultHandler,                      // GPIO Port D 
    IntDefaultHandler,                      // GPIO Port E 
    IntDefaultHandler,                      // UART0 Rx and Tx 
    IntDefaultHandler,                      // UART1 Rx and Tx 
    IntDefaultHandler,                      // SSI0 Rx and Tx 
    IntDefaultHandler,                      // I2C0 Master and Slave 
    IntDefaultHandler,                      // PWM Fault 
    IntDefaultHandler,                      // PWM Generator 0 
    IntDefaultHandler,                      // PWM Generator 1 
    IntDefaultHandler,                      // PWM Generator 2 
    IntDefaultHandler,                      // Quadrature Encoder 0 
    IntDefaultHandler,                      // ADC Sequence 0 
    IntDefaultHandler,                      // ADC Sequence 1 
    IntDefaultHandler,                      // ADC Sequence 2 
    IntDefaultHandler,                      // ADC Sequence 3 
    WatchdogIntHandler,                     // Watchdog timer 
    Timer0IntHandler,                       // Timer 0 subtimer A 
    IntDefaultHandler,                      // Timer 0 subtimer B 
    Timer1IntHandler,                       // Timer 1 subtimer A 
    IntDefaultHandler,                      // Timer 1 subtimer B 
    IntDefaultHandler,                      // Timer 2 subtimer A 
    IntDefaultHandler,                      // Timer 2 subtimer B 
    IntDefaultHandler,                      // Analog Comparator 0 
    IntDefaultHandler,                      // Analog Comparator 1 
    IntDefaultHandler,                      // Analog Comparator 2 
    IntDefaultHandler,                      // System Control (PLL, OSC, BO) 
    IntDefaultHandler,                      // FLASH Control 
    IntDefaultHandler,                      // GPIO Port F 
    IntDefaultHandler,                      // GPIO Port G 
    IntDefaultHandler,                      // GPIO Port H 
    IntDefaultHandler,                      // UART2 Rx and Tx 
    IntDefaultHandler,                      // SSI1 Rx and Tx 
    IntDefaultHandler,                      // Timer 3 subtimer A 
    IntDefaultHandler,                      // Timer 3 subtimer B 
    IntDefaultHandler,                      // I2C1 Master and Slave 
    IntDefaultHandler,                      // Quadrature Encoder 1 
    IntDefaultHandler,                      // CAN0 
    IntDefaultHandler,                      // CAN1 
    IntDefaultHandler,                      // CAN2 
    IntDefaultHandler,                      // Ethernet 
    IntDefaultHandler                       // Hibernate 
};  | 
| void 
ResetISR(void) 
{ 
    // 
    // Jump to the CCS C Initialization Routine. 
    // 
    __asm("    .global _c_int00\n" 
          "    b.w     _c_int00"); 
} 
 | 
| static void 
IntDefaultHandler(void) 
{ 
    // 
    // Go into an infinite loop. 
    // 
    while(1) 
    { 
    } 
}  | 
'embeded > Cortex-M3 Ti' 카테고리의 다른 글
| TI stellarisware / driverlib 기본설정 (uart예제) (4) | 2012.02.05 | 
|---|---|
| Cortex-M3 인터럽트 관련 문서 (0) | 2012.01.31 | 
| Cortex-M3 예제소스 (0) | 2012.01.27 | 
| Cortex-M3 LM3S1968 Evaluation board (0) | 2012.01.27 | 
| ARM cortex-M3 LM3S1607 관련 블로그 (0) | 2012.01.16 | 
