CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

numeric expression must appear? what!?!? where?!?! why!?!?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Pota78



Joined: 09 Sep 2005
Posts: 16

View user's profile Send private message

numeric expression must appear? what!?!? where?!?! why!?!?
PostPosted: Fri Sep 09, 2005 9:41 am     Reply with quote

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: 1903

View user's profile Send private message

PostPosted: Fri Sep 09, 2005 9:45 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Sep 09, 2005 11:57 am     Reply with quote

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: 1903

View user's profile Send private message

PostPosted: Fri Sep 09, 2005 12:03 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Sep 10, 2005 1:58 am     Reply with quote

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 Smile
Pota78



Joined: 09 Sep 2005
Posts: 16

View user's profile Send private message

PostPosted: Sat Sep 10, 2005 3:58 am     Reply with quote

You're right!!
the renamed function is perfect Smile

Thank You Very Much!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group