This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

"using" attribute

Hi,

Anyone can tell me how I can know whether I need to use "using" attribute or not? Attribute "using" ranges 0-3, So which number I have to select? I read Cx51 user guide, it states that:

The using attribute may not be used in functions that return a value in registers. You must exercise extreme care to ensure that register bank switches are performed only in carefully controlled areas. Failure to do so may yield incorrect function results. Even when you use the same register bank, functions declared with the using attribute cannot return a bit value.

Unfortunately, I cannot get point.

Thanks,
pak

Parents
  • If you have more contexts than you have register banks, then some of them must share. If the ones that share can interrupt each other, then they have to save values on the stack.

    dead simple

    you assign main and what it calls to stack 0
    you assign ALL interrupts of low priority to stack 1
    you assign ALL inyerrupts of high proiority to stack 2

    interrupts of the same priority can not interrupt each other

    Erik

Reply
  • If you have more contexts than you have register banks, then some of them must share. If the ones that share can interrupt each other, then they have to save values on the stack.

    dead simple

    you assign main and what it calls to stack 0
    you assign ALL interrupts of low priority to stack 1
    you assign ALL inyerrupts of high proiority to stack 2

    interrupts of the same priority can not interrupt each other

    Erik

Children