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

Passing a pin name to a function error

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







Passing a pin name to a function error
PostPosted: Wed Feb 25, 2004 8:53 pm     Reply with quote

Hi everyone,
I am using CCS C and I would like to pass a pin name to a function, like this:
Code:

#define Test_Pin Pin_D0
void test(int pin)
{
     output_high(pin);    // want Pin_D0 to go high
     output_low(pin);    // want Pin_D0 to go low
}

main()
{
    test(Test_Pin);
}

Somehow, this code doesn't work. Is there anyway around this?
Regards,
Thomas
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 25, 2004 9:12 pm     Reply with quote

Look down near the end of this thread. Mark has posted
two functions that let you pass a CCS-style pin number
as an argument. I think this may solve your problem.
http://www.ccsinfo.com/forum/viewtopic.php?t=18233
thomasn101
Guest







PostPosted: Thu Feb 26, 2004 2:33 pm     Reply with quote

Thank you very much for your help! It solves my problem.
Best regards,
Thomas
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