Skip to content

Commit

Permalink
Correct force inline syntax for IAR compiler
Browse files Browse the repository at this point in the history
Unlinke other compilers supported, the IAR compiler requires the
pre-processor extension to force inline a method to be placed before
the keyword `template` if the method is declared with one.
  • Loading branch information
hugueskamba committed Sep 19, 2019
1 parent 4f7339a commit e2aeb60
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/Ticker.h
Expand Up @@ -83,8 +83,12 @@ class Ticker : public TimerEvent, private NonCopyable<Ticker> {
* @param func pointer to the function to be called
* @param t the time between calls in seconds
*/
template <typename F>
MBED_FORCEINLINE void attach(F &&func, float t)
#if defined(__ICCARM__)
MBED_FORCEINLINE template <typename F>
#else
template <typename F> MBED_FORCEINLINE
#endif
void attach(F &&func, float t)
{
attach_us(std::forward<F>(func), t * 1000000.0f);
}
Expand Down

0 comments on commit e2aeb60

Please sign in to comment.