IAR & OS_CREATETASK() and __task

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • IAR & OS_CREATETASK() and __task

    Hi,

    IAR EWARM allows to put an extended keyword "__task" in front of a thread. If I do so then I get a compiler error in the line of OS_CREATETASK():

    C Source Code

    1. __task extern void TerminalManagerThread(void)
    2. {
    3. ...
    4. }


    in main() I do:

    C Source Code

    1. OS_CREATETASK(&gTerminalThreadTCB, "Terminal-Thread", TerminalManagerThread, 2, gTerminalThreadStack_PU32);


    and get this error:
    Error[Pe167]: argument of type "void (__interwork __task *)(void)" is incompatible with parameter of type "void (*)(void)" D:\ZSE\main.c 762

    Without __task everything works fine. Any idea how to solve this one?

    Thanks, Arne
  • Hello Arne,

    the IAR function type attribute __task relaxes the rules for preserving registers, which means that not all preserved registers are saved on the task stack.
    Right now it is not possible to use it with embOS but it makes not a big difference as long as not much preserverd registers are used in the task routine, e.g. in complex calculations.

    Best regards,
    Til
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.