On Fri, 13 Nov 2009, Raphael Neider wrote:
>> extern SIGHANDLER(rtcHandler) ;
>> DEF_INTHIGH (high_int)
>> DEF_HANDLER (SIG_TMR1, rtcHandler)
>> and in a separate file:
>> SIGHANDLER (rtcHandler)
>> it compiles fine, but the assembler doesn't like it:
>> interrupts.asm:883:Error  Symbol not previously defined
>> If I put everything in the same file it works fine.
>> Is this a limitation of the compiler/assembler, or it just failing to
>> output the neccessary extern references for an __interrupt function
>> SIGHANDLER expands to), or am I missing something terribly obvious!
> The problem here is that the PIC16 backend does not see any use
> of "extern void rtcHandler(void)" and thus incorrectly opts not to
> emit the 'extern _rtcHandler' directive into the .asm file.
> You can work around this issue by replacing
> extern SIGHANDLER(rtcHandler);
> extern unsigned rtcHandler;
> For variables, the PIC16 backend seems to correctly emit the
> 'extern' directive, and as the routine is only used in the
> assembler/macro, the type is no real issue. This is not clean,
> but works for me.
And it's now working for me too.
Unclean as you say, but it's workable.