A pin on which port?

General questions about Firewing...

A pin on which port?

Postby Coccoliso » Thu Nov 09, 2017 9:09 am

Hi,

I would like to know if there is a macro or a way of knowing on which port is a given pin in order to exclude code at compilation level.
User avatar
Coccoliso
 
Posts: 177
Joined: Sat Sep 27, 2014 10:02 am

Re: A pin on which port?

Postby David John Barker » Sun Nov 12, 2017 12:35 pm

I'm not quite sure what you mean - could you give some pseudo code of what you mean...
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: A pin on which port?

Postby Coccoliso » Sun Nov 12, 2017 1:33 pm

Hi David,

I need something that if I pass #option MYPORT = PORTB.0 let me know that we are on PORTB and I use pin 1.
This is because in my module port and bits should end in two different constants otherwise use #if #elseif #else #endif.
User avatar
Coccoliso
 
Posts: 177
Joined: Sat Sep 27, 2014 10:02 am

Re: A pin on which port?

Postby David John Barker » Sun Nov 12, 2017 1:47 pm

If you are wanting to know a port bit at runtime, you have to use BitOf(). If at compile time, then maybe you have to use #if#else etc or in[0..x].
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm


Return to Questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron

x