View previous topic :: View next topic |
Author |
Message |
object01
Joined: 13 May 2004 Posts: 90 Location: Nashville, TN
|
Detecting #use fast_io |
Posted: Tue Dec 21, 2004 9:52 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Dec 21, 2004 10:36 am |
|
|
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
} |
|
|
![](templates/subSilver/images/spacer.gif) |
|