Skip to content

Commit d67faa8

Browse files
committed
Nameless namespace or static linkage don't interfere with IRAM_ATTR, after all.
1 parent fac3a6f commit d67faa8

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/circular_queue/Delegate.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,23 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3636
#include "circular_queue/ghostl.h"
3737
#endif
3838

39+
namespace
40+
{
41+
42+
template<typename R, typename... P>
43+
R IRAM_ATTR vPtrToFunPtrExec(void* fn, P... args)
44+
{
45+
using target_type = R(P...);
46+
return reinterpret_cast<target_type*>(fn)(std::forward<P...>(args...));
47+
}
48+
49+
}
50+
3951
namespace delegate
4052
{
4153
namespace detail
4254
{
4355

44-
template<typename R, typename... P>
45-
R IRAM_ATTR vPtrToFunPtrExec(void* fn, P... args)
46-
{
47-
using target_type = R(P...);
48-
return reinterpret_cast<target_type*>(fn)(std::forward<P...>(args...));
49-
}
50-
5156
#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
5257
template<typename A, typename R, typename... P>
5358
class DelegatePImpl {

0 commit comments

Comments
 (0)