[llvm-dev] MSP430: interrupt vector number out of bounds error in v6/trunk (with patch)

Vadzim Dambrouski via llvm-dev llvm-dev at lists.llvm.org
Sat May 26 08:12:06 PDT 2018


For some time I've been using this defines that allowed me compile the code using both clang and gcc:

#ifdef __clang__
#define ISR_BEGIN(id) __attribute__((interrupt(0)))
#else
#define ISR_BEGIN(id) __attribute__((interrupt(id), used))
#endif

#ifdef __clang__
#define ISR_END(name)                                                          \
    __attribute__((section("__interrupt_vector_" #name), aligned(2))) void (   \
        *__vector_##name)(void) = name;
#else
#define ISR_END(name)
#endif

And I use it like this

ISR_BEGIN(USCI_A0_VECTOR)
void usci_a0(void)
{
}
ISR_END(usci_a0)

ISR_BEGIN(USCI_B0_VECTOR)
void usci_b0(void)
{
}
ISR_END(usci_b0)

But of course fixing it in the compiler would be great.



More information about the llvm-dev mailing list