Loading ...
Sorry, an error occurred while loading the content.
 

aliasinga pseudo variable

Expand Messages
  • Rob Hamerling
    Hi Kyle, 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 ? Regards, Rob. -- Rob
    Message 1 of 4 , Jul 1, 2009
      Hi Kyle,

      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'?

      Regards, Rob.



      --
      Rob Hamerling, Vianen, NL (http://www.robh.nl/
    • zmafoox
      Greetings, ... I d never thought about it. I suppose there s no reason it shouldn t work. --kyle
      Message 2 of 4 , Jul 2, 2009
        Greetings,

        --- In jallist@yahoogroups.com, Rob Hamerling <robhamerling@...> wrote:
        >
        >
        > Hi Kyle,
        >
        > 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'?

        I'd never thought about it. I suppose there's no reason it shouldn't work.

        --kyle
      • Rob Hamerling
        Hi Kyle, [RobH] ... [Kyle] ... Some background info for my question: Some PICs (esp. in the baseline) have no memory mapped TRISIO register. So it is not
        Message 3 of 4 , Jul 3, 2009
          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/)
        • Wouter van Ooijen
          ... IIRC in the old pre-Kyle Jal (which used only bank0 directly) tris always worked that way. -- Wouter van Ooijen --
          Message 4 of 4 , Jul 3, 2009
            > 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!

            IIRC in the old pre-Kyle Jal (which used only bank0 directly) tris
            always worked that way.

            --

            Wouter van Ooijen

            -- -------------------------------------------
            Van Ooijen Technische Informatica: www.voti.nl
            consultancy, development, PICmicro products
            docent Hogeschool van Utrecht: www.voti.nl/hvu
          Your message has been successfully submitted and would be delivered to recipients shortly.