@@ -38,25 +38,25 @@ class Ticker
3838 void attach_scheduled (float seconds, callback_function_t callback)
3939 {
4040 _callback_function = [callback]() { schedule_function (callback); };
41- _attach_ms (1000UL * seconds, true , _static_callback, this );
41+ _attach_ms (1000UL * seconds, true );
4242 }
4343
4444 void attach (float seconds, callback_function_t callback)
4545 {
4646 _callback_function = std::move (callback);
47- _attach_ms (1000UL * seconds, true , _static_callback, this );
47+ _attach_ms (1000UL * seconds, true );
4848 }
4949
5050 void attach_ms_scheduled (uint32_t milliseconds, callback_function_t callback)
5151 {
5252 _callback_function = [callback]() { schedule_function (callback); };
53- _attach_ms (milliseconds, true , _static_callback, this );
53+ _attach_ms (milliseconds, true );
5454 }
5555
5656 void attach_ms (uint32_t milliseconds, callback_function_t callback)
5757 {
5858 _callback_function = std::move (callback);
59- _attach_ms (milliseconds, true , _static_callback, this );
59+ _attach_ms (milliseconds, true );
6060 }
6161
6262 template <typename TArg>
@@ -76,25 +76,25 @@ class Ticker
7676 void once_scheduled (float seconds, callback_function_t callback)
7777 {
7878 _callback_function = [callback]() { schedule_function (callback); };
79- _attach_ms (1000UL * seconds, false , _static_callback, this );
79+ _attach_ms (1000UL * seconds, false );
8080 }
8181
8282 void once (float seconds, callback_function_t callback)
8383 {
8484 _callback_function = std::move (callback);
85- _attach_ms (1000UL * seconds, false , _static_callback, this );
85+ _attach_ms (1000UL * seconds, false );
8686 }
8787
8888 void once_ms_scheduled (uint32_t milliseconds, callback_function_t callback)
8989 {
9090 _callback_function = [callback]() { schedule_function (callback); };
91- _attach_ms (milliseconds, false , _static_callback, this );
91+ _attach_ms (milliseconds, false );
9292 }
9393
9494 void once_ms (uint32_t milliseconds, callback_function_t callback)
9595 {
9696 _callback_function = std::move (callback);
97- _attach_ms (milliseconds, false , _static_callback, this );
97+ _attach_ms (milliseconds, false );
9898 }
9999
100100 template <typename TArg>
@@ -117,6 +117,10 @@ class Ticker
117117protected:
118118 static void _static_callback (void * arg);
119119 void _attach_ms (uint32_t milliseconds, bool repeat, callback_with_arg_t callback, void * arg);
120+ void _attach_ms (uint32_t milliseconds, bool repeat)
121+ {
122+ _attach_ms (milliseconds, repeat, _static_callback, this );
123+ }
120124
121125 ETSTimer* _timer;
122126 callback_function_t _callback_function = nullptr ;
0 commit comments