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

How to detect if some stream is defined?

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



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

How to detect if some stream is defined?
PostPosted: Fri Nov 25, 2011 11:04 am     Reply with quote

How to detect if some stream is defined?

E.g.
Code:

/*
This example not works.
#ifndef directive not detects RF24_SPI stream
*/

#USE SPI(SPI1, FORCE_HW, BAUD=4000000, STREAM=RF24_SPI)

#ifndef RF24_SPI
   #USE SPI(SPI2, FORCE_HW, MASTER, BAUD=4000000, MODE=0, STREAM=RF24_SPI)  //<-generate an error
   #warning RF24_SPI initialized as SPI2     //<-this warning is shown-up
#endif


Thanks
_________________
Eduardo Guilherme Brandt
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 25, 2011 3:53 pm     Reply with quote

I'm not sure if the stream can be recognized outside of the #use rs232()
library. But you do everything you want with conditional define
statements, such as #ifdef, #else, #ifndef, etc., by just using normal
methods.
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Fri Nov 25, 2011 4:41 pm     Reply with quote

Dear Mr. PCM,

but, do you know how to detect if some STREAM was initialized or not?
_________________
Eduardo Guilherme Brandt
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 25, 2011 6:26 pm     Reply with quote

I just wanted to offer a small tip. I don't want to spend more time working
on this type of problem.
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