View previous topic :: View next topic |
Author |
Message |
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
stream query |
Posted: Thu Mar 22, 2018 5:27 am |
|
|
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: 19520
|
|
Posted: Thu Mar 22, 2018 10:03 am |
|
|
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: 9229 Location: Greensville,Ontario
|
|
Posted: Thu Mar 22, 2018 10:22 am |
|
|
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
|
|
Posted: Sat Mar 24, 2018 5:24 am |
|
|
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!!!! |
|
|
|