[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] calls of run-time library during interrupts

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] calls of run-time library during interrupts
Date: Fri, 9 Aug 2002 17:31:06 +0200 (MET DST)

"Roland Zitzke" <address@hidden> wrote:

> I wonder if the call to __divmodhi4
> causes the problem?

Looking at the source, it clobbers r21 through r27.  They are supposed
to be saved during an interrupt routine:

.global __vector_16
        .type   __vector_16,@function
/* prologue: frame size=0 */
        push __zero_reg__
        push __tmp_reg__
        in __tmp_reg__,__SREG__
        push __tmp_reg__
        clr __zero_reg__
        push r18
        push r19
        push r20
        push r21
        push r22
        push r23
        push r24
        push r25
        push r26
        push r27
/* prologue end (size=15) */
        lds r24,volume_pwm_0
        clr r25
        mul r18,r24
        movw r20,r0
        mul r18,r25
        add r21,r0
        mul r19,r24
        add r21,r0
        clr r1
        movw r24,r20
        ldi r22,lo8(100)
        ldi r23,hi8(100)
        call __divmodhi4
        sts (blah)+1,r23
        sts blah,r22
/* epilogue: frame size=0 */
        pop r27
        pop r26
        pop r25
        pop r24
        pop r23
        pop r22
        pop r21
        pop r20
        pop r19
        pop r18
        pop __tmp_reg__
        out __SREG__,__tmp_reg__
        pop __tmp_reg__
        pop __zero_reg__

Can you verify this is also the case for you?

Do you perhaps re-enable interrupts within your interrupt handler?

J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/
avr-gcc-list at http://avr1.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]