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

Problem with passing parameters

Hey guys,

I've got a huge problem with passing arguments to an invoked function. It just doesn't work, at least sometimes... I can't figure out why this could possibly happen, but it does. My application is very small, just a few KB, thats why I dont assume there is a stack overflow or something like that. Any other guesses or maybe even solutions?

Thanks

Parents
  • Waht about functions the in the ISR called function calls, like UART_vTransmitASCII() in my case. Do I need to specify the register bank there according to the one used for the ISR, too?

    Let me try one sentence:
    any function must have the same 'using' as the code it is called from.

    does that answer your question?

    Erik

Reply
  • Waht about functions the in the ISR called function calls, like UART_vTransmitASCII() in my case. Do I need to specify the register bank there according to the one used for the ISR, too?

    Let me try one sentence:
    any function must have the same 'using' as the code it is called from.

    does that answer your question?

    Erik

Children
  • "any function must have the same 'using' as the code it is called from."

    And that includes the case of an ISR without any 'using' at all, the called functions would also lack any special qualifiers.

  • Ok, thanks for that again. So I removed all using x statements, since this is the simlest solution, and it still doesn't work propperly... Any othr guesses or am I not allowed to remove the using behind the ISR?

    Best

    Chris

  • Another thing, the KEIL Help File says:

    The using attribute is most useful in interrupt
    functions. Usually a different register bank is
    specified for each interrupt priority level.
    Therefore, you could assign one register bank for all
    non-interrupt code, a second register bank for the
    high-level interrupt, and a third register bank for the
    low-level interrupt.
    


    It doesn't mention anything about any function must have the same 'using' as the code it is called from and unfortunately this wasn't the problem im my application, too. But maybe I just got it all wrong;)

    Any other guesses?

  • ...any function must have the same 'using' as the code it is called from...

    That's not EXACTLY correct. You can create registerbank-independent functions using the NOAREGS directive.

    Refer to the following knowledgebase article for more informaiton:

    http://www.keil.com/support/docs/598.htm

    Jon