| ??? 05/01/02 13:41 Read: times |
#22357 - RE: passing port pin (to Mahmood) |
Either you cannot explain what you want, or you do not understand it yourself.
First, usually (and that is the case of standard header files) ports and their pins are declared in headers, so, they are GLOBAL variables and can be used by any function of your code without passing them explicitly. If it is not your case, in other words, if do not want to use standard header files, the question is WHERE do you declare your sfr's and your sbit's? Once again, if you do it outside of your function, it is a GLOBAL variable, see above. If you do it inside of your function, than what is the reason for doing so? Second, what do you want your function to do with your pins? If your function uses the pin value to modify some other object, probably it is reasonable. But if it is as in your example, just changing the pin value, YOU DO NOT NEED ANY FUNCTION, direct attribution will do. Why not to write instead of a doubtful construction DGIO_setDiscrete(RedLED, ON); //your example a simple expression RedLED = ON; ??? |



