I have various control lines for external DA converters, relays etc.
I may have something like:
PORTB.2 - datalatch PORTD.2 - datastrobe
I can access these by using:
Which can be improved by using a define:
define datalatch 2
define datastrobe 2
Which means I can use:
My question is, is there a way to substitute 'PORTB,2' with a named string constant?
This would mean I could use: bitSet(datalatch);
It makes no difference to the executable code, but makes the code easier to read and especially easier to debug, in the first two cases cut and paste editing can easily result in PORTB and PORTB being incorrectly used and a significant time spent in debugging.