View previous topic :: View next topic |
Author |
Message |
Pota78
Joined: 09 Sep 2005 Posts: 16
|
numeric expression must appear? what!?!? where?!?! why!?!? |
Posted: Fri Sep 09, 2005 9:41 am |
|
|
Hi all,
This is my code... with another compiler it works just fine but with the ccs 3.187 it doesn't work!
The error it gives to me is the famous "A numeric expression must appear here", but the code is perfect to me...
Thanks for you help guys!
int32 read_ADC(int numero_bit){
int i;
int32 letto=0;
Enable_ADC();
for(i=0 ; i<numero_bit+1 ; i++){
clk_adc=1;
if(dout_adc) letto |= 0x01;
clk_adc=0;
if (i != (numero_bit)) letto = letto<<1;
}
Disable_ADC();
return (letto) ;
}
//**************************************************************************
// Lettura (8 bit) da un Registro Generico (address) dal convertitore
//**************************************************************************
int32 read_8_ADC(char address){
int32 letto1;
Enable_ADC();
//adc_commw(address| single_read);
Disable_ADC();
letto1 = read_ADC(8); ---->The error appear here after the "8"!!
return(letto1);
}
p.s. if I write only "read_ADC(9);" instead of "letto1=read_ADC(9);" the error does not occur...but i need letto1!!! |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Fri Sep 09, 2005 9:45 am |
|
|
Look up "read_adc()" in the help file. It does not accept an argument.
So,
Code: | letto1 = read_adc(); // valid
letto1 = read_adc(8); // not valid |
|
|
|
Pota78
Joined: 09 Sep 2005 Posts: 16
|
|
Posted: Fri Sep 09, 2005 11:57 am |
|
|
Thank you, but the read_adc() function is a function I have created on my own...
is there a built-in function with the same name?
(sorry for the bad english...) |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Fri Sep 09, 2005 12:03 pm |
|
|
Yup. Look in the help file.
In the meantime, try renaming your function to my_read_adc() and try recompiling to see if the error goes away. |
|
|
Pota78
Joined: 09 Sep 2005 Posts: 16
|
|
Posted: Sat Sep 10, 2005 1:58 am |
|
|
Thank you very much, i'll try to rename the function, I hope the problem is here... I'll let you know if the problem will be solved...
Thank you again |
|
|
Pota78
Joined: 09 Sep 2005 Posts: 16
|
|
Posted: Sat Sep 10, 2005 3:58 am |
|
|
You're right!!
the renamed function is perfect
Thank You Very Much!! |
|
|
|