EmbeddedRelated.com
Forums

compiler error on external interrupt

Started by wantoniet August 22, 2005
Hi folks,

Ive got a problem with compilation a sw through CCS compiler. Im
using PIC18f452 and error occur on external interrupt0. A piece of my
sw described below:

...
ext_int_edge(0,h_to_l);
enable_interrupts(int_ext);
enable_interrupts(global);
clear_lcd(); while(true)
{
comand_lcd(0x80);
printf(write_lcd,"Waiting int. ");
delay_ms(1000);
}

#int_ext
void int_ext_isr()
{
clear();
comand_lcd(0x80);
printf(write_lcd,"Received!!");
receive_data();
decoder_data();
} Compiler show "A numeric expression must appear here" on "int_ext"
line.

Well, i really cant understand why occur this error. Any ideas? Any
help?

Thanks, Wilson




I don't use that compiler so I am just guessing but...

The # symbol usually starts a preprocessor command. I don't think
the line is a valid preprocessor statement so I think it needs to be
removed or changed to a comment.

But, I am just guessing... --- In piclist@picl..., "wantoniet" <wantoniet@y...> wrote:
> Hi folks,
>
> Ive got a problem with compilation a sw through CCS compiler. Im
> using PIC18f452 and error occur on external interrupt0. A piece of
my
> sw described below:
>
> ...
> ext_int_edge(0,h_to_l);
> enable_interrupts(int_ext);
> enable_interrupts(global);
> clear_lcd(); > while(true)
> {
> comand_lcd(0x80);
> printf(write_lcd,"Waiting int. ");
> delay_ms(1000);
> }
>
> #int_ext
> void int_ext_isr()
> {
> clear();
> comand_lcd(0x80);
> printf(write_lcd,"Received!!");
> receive_data();
> decoder_data();
> } > Compiler show "A numeric expression must appear here" on "int_ext"
> line.
>
> Well, i really cant understand why occur this error. Any ideas?
Any
> help?
>
> Thanks, Wilson



You need to specify which external interrupt you're using which
would be zero ( #int_ext0 ). the compiler is complaining about the
number missing behind the #int_ext. --- In piclist@picl..., "wantoniet" <wantoniet@y...> wrote:
> Hi folks,
>
> Ive got a problem with compilation a sw through CCS compiler.
Im
> using PIC18f452 and error occur on external interrupt0. A piece of
my
> sw described below:
>
> ...
> ext_int_edge(0,h_to_l);
> enable_interrupts(int_ext);
> enable_interrupts(global);
> clear_lcd(); > while(true)
> {
> comand_lcd(0x80);
> printf(write_lcd,"Waiting int. ");
> delay_ms(1000);
> }
>
> #int_ext
> void int_ext_isr()
> {
> clear();
> comand_lcd(0x80);
> printf(write_lcd,"Received!!");
> receive_data();
> decoder_data();
> } > Compiler show "A numeric expression must appear here" on "int_ext"
> line.
>
> Well, i really cant understand why occur this error. Any ideas?
Any
> help?
>
> Thanks, Wilson