avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Two interrupts with same handlers


From: Rich Neswold
Subject: Re: [avr-gcc-list] Two interrupts with same handlers
Date: Tue, 4 Dec 2001 23:45:16 -0600
User-agent: Mutt/1.2.5i

Wasn't it  4-Dec-2001, at 02:36PM, when Larry Barello said:
> Easy: write one interrupt handler in assembly and just have it
> jump to the real handler. Say your overflow handler is the real
> one, then make a new file with the following:.
> 
>     .func myfunc
>     .global _comparator_
> 
> _comparator_:
>     rjmp    _overflow0_
> 
>     .endfunc

Or use "--defsym _overflow0_=_comparator_" when linking, which essentially
gives the one routine two labels. For instance, if you link with the
compiler, you could do something like this:

    $ avr-gcc \
        -mmcu=at90s2313 \
        -Wl,--defsym,_comparator_=_overflow0_ \
        -o prog.bin \
        file1.o file2.o file3.o

The "-Wl" option specifies options to pass to the linker. The "defsym"
option tells the linker to create a new symbol and set its value -- in this
case, we create a symbol "_comparator_" and set it equal to "_overflow0_".
If you use avr-objdump on the resulting "prog.bin" file, you'll see the
vector table will have two entries pointing to the same routine.

-- 
 Rich Neswold

 efax: 1.240.536.7092
  web: www.enteract.com/~rneswold/

Attachment: pgpM5Jq3WVE12.pgp
Description: PGP signature


reply via email to

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