Hi Kyle,
[RobH]
>> I've tried it and is seems to work: declaring and using an alias for a
>> pseudo-variable. But just to make sure, is this 'legal'?
[Kyle]
> I'd never thought about it. I suppose there's no reason it shouldn't work.
Some background info for my question:
Some PICs (esp. in the baseline) have no memory mapped TRISIO register.
So it is not possible to declare (let's say for the 10F222) a var like:
var volatile bit pin_A0_direction at TRISIO : 0
to be able to use (in any library) a statement like:
pin_A0_direction = OUTPUT
To make this possible I declare a pseudo variable 'pin_A0_direction'
with the required statements (in Assembler).
So far so good, but now I want (in an ADC library) to access pin_AN0,
which is an alias of pin_A0 (for the 10F222, for others it may be a
different pin), and also to set its direction with the name
pin_AN0_direction. So I declare aliases like:
var volatile bit pin_AN0 is pin_A0
var volatile bit pin_AN0_direction is pin_A0_direction.
independent whether pin_A0 and pin_A0_direction are real or a pseudo
variables.
There are more situations where it is useful to declare an alias to a
pseudo variable. Hopefully you understand (better) the usefulness and
the importance for me to be reassured!
Regards, Rob.
--
Rob Hamerling, Vianen, NL (
http://www.robh.nl/)