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

Detecting #use fast_io

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



Joined: 13 May 2004
Posts: 90
Location: Nashville, TN

View user's profile Send private message Send e-mail Visit poster's website

Detecting #use fast_io
PostPosted: Tue Dec 21, 2004 9:52 am     Reply with quote

I've recently been frustrated by the output_*() functions only accepting constants as parameters. I'm trying to build a multi-mode driver that handles a variable number of FLASH RAMs on SPI, configurable at compile-time, and selecting/deselecting chip-select lines is a little tedious now. So I thought about writing my own output_functions that do the same thing, but I need to be able to detect whether #use fast_io is in effect. I didn't see anything for detecting this using getenv(). Is there a way?

--
Jeff S.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Dec 21, 2004 10:36 am     Reply with quote

Quote:
I've recently been frustrated by the output_*() functions only
accepting constants as parameters

See this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=18480
Quote:
but I need to be able to detect whether #use fast_io is in effect.

Something like this would probably work. If you don't want to use
fast_io, then comment out the #define statement.

Code:
#include <16F877.h>
#fuses XT, NOWDT, PUT, BROWNOUT, NOLVP
#use delay(clock=4000000)

#define USE_FAST_IO_B  1

#ifdef USE_FAST_IO_B
  #use fast_io(B)
#endif

void main()
{


#ifdef USE_FAST_IO_B
// Put your code here.
#endif

}
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