[Top][All Lists]

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

Re: [avr-gcc-list] Forced Linking

From: Tvrtko A. Ursulin
Subject: Re: [avr-gcc-list] Forced Linking
Date: Fri, 7 Mar 2003 00:27:59 +0100
User-agent: KMail/1.4.3

On Thursday 06 March 2003 22:47, Keith Gudger wrote:

> I have some AVR interrupt routines in an archive file.  When I run the
> linker, they get left out, as nothing in my source files refers to them.
> Obviously, the linked code doesn't work.

> Any ideas?  Thanks.

There usually must be some code which initializes interrupt in question. I 
have solved that problem by putting that function in the same source file as 
the interrupt handler. In that way it is linked in if application calls the 
initialization function - which it really must do to use it.

For example here is a snippet from my serial.c:

void    serial_init(void)
        fifo_init((struct fifo 
        fifo_init((struct fifo 

        if ( serial_rx_space() )
                #ifdef CONFIG_SERIAL_OPTIMIZED
                _fifo_push((struct fifo *)&serial.rx_fifo,inp(UDR));
                fifo_push((struct fifo *)&serial.rx_fifo,inp(UDR));     


reply via email to

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