Bit Range Constants
I think that the answer to my question is "It cannot be done: SPIN limitation", but I thought that I would ask.
What I would like to do is setup a CONstant:
I know that I can do
but that hides those pins down in the code. Bad programming practice.
Or I could read them a bit at a time, but I would rather read all 8 bits at once.
Post Edited (Chuck Rice) : 4/17/2009 2:43:20 AM GMT
What I would like to do is setup a CONstant:
CON
digitalInputsBasePin = 8
digitalInputsRange = digitalInputsBasePin..digitalInputsBasePin+8
VAR
long digitalInputs
PUB xxx(yyy)
digitalInputs := INA(digitalInputsRange)
I know that I can do
digitalInputs := INA(8..15)
but that hides those pins down in the code. Bad programming practice.
Or I could read them a bit at a time, but I would rather read all 8 bits at once.
Post Edited (Chuck Rice) : 4/17/2009 2:43:20 AM GMT

Comments
CON digitalInputsBasePin = 8 digitalInputsHiPin = digitalInputsBasePin+7 VAR long digitalInputs PUB xxx(yyy) digitalInputs := INA[noparse][[/noparse]digitalInputsBasePin..digitalInputsHiPin]-Phil