Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By philbowles
#69028 This is rooted in the underlying os_ call and esp8266 h/w timer. It has a single (32-bit wide) function address and a single uint32_t type argument. Thus unless you use the arg to pass a class pointer, you are stuck with static methods.

I get round this by having an instance of the class in global scope (let's call it X) and then calling X.whatever() inside the static ticker function. It ugly and "hacky" but it works.

Since the os_ timer requires that a single physical function address is known at call-time, I can't see a way around this. I'm going to experiment with std::function type objects (which can "wrap" a member function) but I'm fairly new to those, so I don't hold out much hope...even if it's possible, it would require a new version of Ticker which has a std::function prototype - unless of course someone else knows better....