Skip to main content
Visitor II
April 24, 2009
Question

Does STVD suport static inline key to declare function?

  • April 24, 2009
  • 5 replies
  • 1051 views
Posted on April 24, 2009 at 13:31

Does STVD suport static inline key to declare function?

    This topic has been closed for replies.

    5 replies

    wolverAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:02

    Hello

    ''static inline'' key to declare function have error in STVD. I know GCC suport ''static inline'', Then STVD?

    Redards

    wolver

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:02

    Hi wolver,

    I think this is related to the compiler:

    With cosmic compiler you can do this by the directive @inline

    With raisonnance compiler you can check the compiler option ''SPEED optimization'' and the compiler do this automatically

    Regards

    mozra

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:02

    just out of curiosity: why would you want to inline functions ?

    wolverAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:02

    Hi mozra

    I use STM8 Cosmic, not raisonnance. But I should try to do it by the directive @inline ...

    Regards

    wolver

    wolverAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:02

    Hi _luca

    We have some short fuctions, such as following... If ''static inline'' can be used, The compiler obj has not push-pop stack.

    Regards

    wolver

    PS: some short fuctions...

    void ModifyCurSystemStatus(unsigned char current_status)

    {

    g_ucSystemCurStatus = current_status;

    }

    unsigned char GetCurSystemStatus(void)

    {

    return g_ucSystemCurStatus;

    }

    void load_timer3_value(void)

    {

    TIM3_CNTRH = 0x1E;

    TIM3_CNTRL = 0xFF;

    }