The macro:

#define CLASS_ISR(vector, ...) { vector(); } ISR(vector)

when used in the class method:

void CTimer0Interrupt::TIMER0_OVF_vect(void) 
            CLASS_ISR(TIMER0_OVF_vect, ISR_BLOCK)
{
    TCNT0 = TIMER0_TIMEOUT;     // restart the timeout
    Timer0.SetOverflowFlag();
}

becomes:

void CTimer0Interrupt::__vector_16(void) { __vector_16(); } 
extern "C" void __vector_16(void) 
        __attribute__ ((signal,used,externally_visible)); 
void __vector_16 (void)
{
    (*(volatile uint8_t *)((0x32) + 0x20)) = 100;
    Timer0.SetOverflowFlag();
}

which, from the interrupt system's point of view, is the same as the code:

ISR(TIMER0_OVF_vect)
{
    TCNT0 = TIMER0_TIMEOUT;     // restart the timeout
    Timer0.SetOverflowFlag();
}

This works fine if SetOverflowFlag is defined as public, but this is
essentially where I started. 

IMHO the only way is to define the interrupt method in the class with
interrupt attributes and then alias the mangled name to the AVR vector so
the compiler can find it during global name reconciliation. This would be
very neat and simple if we could develop a simple name mangling macro.

Ron




_______________________________________________
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to