This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

meaning of #pragma

#pragma vector=TIMERA1_VECTOR

__interrupt void Timer_A(void){

}

Does  it mean linking assembly code and embedded c?

  • Nikita Hosur said:
    Does  it mean linking assembly code and embedded c?

    No. It does not mean that. Perhaps this will answer your question:

    http://gcc.gnu.org/onlinedocs/cpp/Pragmas.html

  • a pragma is a compiler instruction that is provided inside the code file rather than as a commandline parameter.
    The precompiler, which usually interprets and removes all lines beginning with a #, will forward the #pragma untouched to the compiler.

    The meaning of a pragma is 100% compiler dependent. Different compielrs might understand different pragmas and choke on others. Usually, a pragma is not portable. Check the compile rmanual for details.

    this specific pragma tells the compiler that the next function following the pragma is an ISR and needs an entry in the interrupt vector table.

**Attention** This is a public forum