I tried this:
Void_t (*Timer_A0_Ptr)( Void_t );
Void_t (*Usart1_Rx_Ptr) (Void_t);
Timer_A0_Ptr=&Timer_A0;
Usart1_Rx_Ptr=&Usart1_Rx;
The functions header are:
interrupt( TIMERA0_VECTOR ) Timer_A0( Void_t ); and
interrupt( UART1RX_VECTOR ) Usart1_Rx( Void_t );
The linker doesn't add the functions. It says they are not used.
However if I call the interrupt functions like this in main:
Timer_A0();
Usart1_Rx();
I can see that the code size has gone up, which makes me think they were
linked somehow. The difference in size corresponds to the function sizes.
However, the code doesn't work.
Any other solutions/comments?
Thank you,
Yvan
From: "Thomas W. Carley" <[email protected]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: [Mspgcc-users] Problem linking interrupt functions in library
Date: Fri, 29 Jul 2005 10:20:43 -0400
One simple hack is to reference the function, for instance set a pointer to
it.
Yvan Castilloux wrote:
Ok,
You're saying that functions in the libary that are not direclty called
are not linked. Do you have any solution to suggest besides not putting
these functions in the library? I'm sure there's a way to make them link
since interrupt functions are a special case.
Thank you very much,
Yvan
From: "diwil" <[email protected]>
Reply-To: [email protected]
To: <[email protected]>
Subject: RE: [Mspgcc-users] Problem linking interrupt functions in
library
Date: Fri, 29 Jul 2005 12:11:16 +0400
If object code does not refer some function residing in library, the last
one will not be linked.
~d
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Yvan
Castilloux
Sent: Friday, July 29, 2005 12:25 AM
To: [email protected]
Subject: [Mspgcc-users] Problem linking interrupt functions in library
Hi,
I use msp430-ar to make a library of functions. When I include the
interrupt functions in the library, the linker just disregard them. For
instance, the following function with header
interrupt( UART0RX_VECTOR ) Usart0_Rx( Void_t )
{
...
}
will not link if it is pre-compiled in the library but it will if it is
compiled normally.
Here are the commands I use in the make file:
1-library
ldevicelib: $(DEVICE_OBJS) $(DEVICE_HEAD)
msp430-ar -ruv $(LIBDIR)/libdevicelib.a $(DEVICE_OBJS) ;
2-compiling
$(OBJ_DIR)/%.o : $(SRCDIR)/%.c
$(CC) $(CCOPTIONS) $(OPTIMIZER) $(DEBUGGER) $(DEFINED) -I$(INCLDIR)
-I$(CC_INC_DIR) $< -o $@
3-linking
rfseals.elf : ${OBJECTS}
${CC} -mmcu=${CPU} -o $@ -L$(LIBDIR) ${OBJECTS}
$(LDFLAGS) \
-ldevicelib
Any commments?
The only thing I can think of is that the linker disregards them because
it
thinks the functions are not used anywhere (they are not called in the
code
like standard functions). Can you force the linkage then?
Thank you,
Yvan
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing &
QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing &
QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users