Skip to content

Commit e2aeb60

Browse files
committed
Correct force inline syntax for IAR compiler
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.
1 parent 4f7339a commit e2aeb60

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/Ticker.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,12 @@ class Ticker : public TimerEvent, private NonCopyable<Ticker> {
8383
* @param func pointer to the function to be called
8484
* @param t the time between calls in seconds
8585
*/
86-
template <typename F>
87-
MBED_FORCEINLINE void attach(F &&func, float t)
86+
#if defined(__ICCARM__)
87+
MBED_FORCEINLINE template <typename F>
88+
#else
89+
template <typename F> MBED_FORCEINLINE
90+
#endif
91+
void attach(F &&func, float t)
8892
{
8993
attach_us(std::forward<F>(func), t * 1000000.0f);
9094
}

0 commit comments

Comments
 (0)