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 CCS Technical Support

Case Sensitivity

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



Joined: 18 Nov 2013
Posts: 160

View user's profile Send private message

Case Sensitivity
PostPosted: Thu Feb 26, 2015 9:42 am     Reply with quote

I was curious of anyone here had ever enabled case sensitivity and what the results were. Did any of the built-in libraries have problems? Did it cause lots of extra work?

I really would like the code to be case sensitive, as C is supposed to be, but the warnings in the manual that CCS libs are not tested with case sensitivity enabled scares me.

If you enable case sensitivity with #CASE, the stream identifiers are no longer recognized, even if they are the same case.
Code:

#CASE
#USE RS232( BAUD=9600, STREAM=com1 );
...
val = fgetc( com1 );  // <-- ERROR: Undefined identifier
 
Ttelmah



Joined: 11 Mar 2010
Posts: 19499

View user's profile Send private message

PostPosted: Thu Feb 26, 2015 1:43 pm     Reply with quote

You should have pins or a UART selected, but the reason is that stream names _must_ be capitals, if case is selected.
You will see that all example stream names are capitals only. The #USE RS232 function defaults to treating all text internally as capitals.
So this:
Code:

#CASE

#USE RS232(UART1, BAUD=9600, STREAM=com1)
//or
#USE RS232(UART1, BAUD=9600, STREAM=COM1)

void main()
{
   int8 val;
   val = fgetc(COM1);

}

Will work.
SeeCwriter



Joined: 18 Nov 2013
Posts: 160

View user's profile Send private message

PostPosted: Thu Feb 26, 2015 6:17 pm     Reply with quote

That fixed it. Thanks. So far I've run across no other issues. But it's early yet.
jeremiah



Joined: 20 Jul 2010
Posts: 1345

View user's profile Send private message

PostPosted: Thu Feb 26, 2015 7:43 pm     Reply with quote

I've used #case almost my entire time using CCS. So far no issues with it at all. I think in general it is a good idea to turn it on.
Ttelmah



Joined: 11 Mar 2010
Posts: 19499

View user's profile Send private message

PostPosted: Fri Feb 27, 2015 12:13 pm     Reply with quote

I must admit, the one I've had trouble with, is signed versus unsigned.
Had a couple of libraries give problems when I changed the default integer type. #case has given me no problems, except for the occasional 'oddity' like this one.
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