Am 30.12.2002 22:09:45, schrieb "Mark Stokes" <[email protected]>:
>I had a bit of trouble understanding that last statement, but here's
>what I found.
>I had declared the IRQ as "naked". I was unaware that this also removes
>the ret (or reti) instruction. I don't quite understand this, but I can
>live with it.
"naked" removes any function prologue and epilogue.
>So, now I have two questions:
>1. How do tell the compiler to include the ret (or reti) instruction if
>the function is void?
don't use "naked" or put a __asm__ ("reti")
>2. How do I tell the compiler to change the SR bit in the saved SR on
>the stack so that the CPU turns back on after the BT irq service has
>ended? I thought the "wakeup" keyword would do this, but I see no code
>being generated when I add this. Is there a header that acts on the
>"wakeup" keyword?
i think "naked" is stronger than "wakeup".
BIC_SR_IRQ(LPM0_bits);
or so is a C macro you might like ;-)
inspect signal.h in the msp430 include files
>
>Sample:
>interrupt (BASICTIMER_VECTOR) wakeup BasicTimerIRQ(void)
>{
> nop( );
> 1422: 03 43 nop
> P1OUT=~P1OUT; //invert port 1
> 1424: f2 e3 21 00 xor.b #-1, &0x0021
>}
> 1428: 00 13 reti
>
>
>Thanks for the help.
>-Mark