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

stream query

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



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

stream query
PostPosted: Thu Mar 22, 2018 5:27 am     Reply with quote

OK I finally got bit by this 'quirk' when using streams as I used ANSI in a sunrise/sunset program( chicken coop project).
It turns out that the name of the stream MUST BE ALL UPPERCASE.

#use RS232(UART1, stream=pclink) does NOT compile

#useRS232(UART1,stream=PCLINK) does compile

I trierd several versions and combinations...only uppercase works for names.

I can't find anything in the manual about 'upper case only' for stream names.
Has anyone else noticed this or is it a 'C' standard. Since day one( PCM 2.534) I've never used #CASE as I'm a lousy typist,old ,hate long names and well, have muddled along fine until last night....

just curious.
Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Thu Mar 22, 2018 10:03 am     Reply with quote

Streams don't exist in 'historical C'. However there is an old 'semi standard' to reserve 'ALL CAPITALS' for things like #defines and enums rather than standard variables. Forcing stream names to abide to this is very sensible, and it looks like this is what the compiler is doing. It is just a pity it seems 'undocumented'....
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Mar 22, 2018 10:22 am     Reply with quote

What got me is in the manual, in #use rs232(STREAM=id)....note id is in lowercase. I would have tweaked if it'd been STREAM=ID.
The same with the printf() info....
fprintf (stream, cstring, values...)
again stream is in lowercase not the required UPPERCASE

Considering how long I've been using CCS, it took 2+decades to get bit !
But... I will remember this, so you can teach an old dog some tricks !

Jay
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Mar 24, 2018 5:24 am     Reply with quote

I just tested this in 5.077 and everything works normally.
With ANSI it is case sensitive and without ANSI it is not.
I also tested with several previous versions.
_________________
Google and Forum Search are some of your best tools!!!!
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