@@ -38,25 +38,25 @@ class Ticker
38
38
void attach_scheduled (float seconds, callback_function_t callback)
39
39
{
40
40
_callback_function = [callback]() { schedule_function (callback); };
41
- _attach_ms (1000UL * seconds, true , _static_callback, this );
41
+ _attach_ms (1000UL * seconds, true );
42
42
}
43
43
44
44
void attach (float seconds, callback_function_t callback)
45
45
{
46
46
_callback_function = std::move (callback);
47
- _attach_ms (1000UL * seconds, true , _static_callback, this );
47
+ _attach_ms (1000UL * seconds, true );
48
48
}
49
49
50
50
void attach_ms_scheduled (uint32_t milliseconds, callback_function_t callback)
51
51
{
52
52
_callback_function = [callback]() { schedule_function (callback); };
53
- _attach_ms (milliseconds, true , _static_callback, this );
53
+ _attach_ms (milliseconds, true );
54
54
}
55
55
56
56
void attach_ms (uint32_t milliseconds, callback_function_t callback)
57
57
{
58
58
_callback_function = std::move (callback);
59
- _attach_ms (milliseconds, true , _static_callback, this );
59
+ _attach_ms (milliseconds, true );
60
60
}
61
61
62
62
template <typename TArg>
@@ -76,25 +76,25 @@ class Ticker
76
76
void once_scheduled (float seconds, callback_function_t callback)
77
77
{
78
78
_callback_function = [callback]() { schedule_function (callback); };
79
- _attach_ms (1000UL * seconds, false , _static_callback, this );
79
+ _attach_ms (1000UL * seconds, false );
80
80
}
81
81
82
82
void once (float seconds, callback_function_t callback)
83
83
{
84
84
_callback_function = std::move (callback);
85
- _attach_ms (1000UL * seconds, false , _static_callback, this );
85
+ _attach_ms (1000UL * seconds, false );
86
86
}
87
87
88
88
void once_ms_scheduled (uint32_t milliseconds, callback_function_t callback)
89
89
{
90
90
_callback_function = [callback]() { schedule_function (callback); };
91
- _attach_ms (milliseconds, false , _static_callback, this );
91
+ _attach_ms (milliseconds, false );
92
92
}
93
93
94
94
void once_ms (uint32_t milliseconds, callback_function_t callback)
95
95
{
96
96
_callback_function = std::move (callback);
97
- _attach_ms (milliseconds, false , _static_callback, this );
97
+ _attach_ms (milliseconds, false );
98
98
}
99
99
100
100
template <typename TArg>
@@ -117,6 +117,10 @@ class Ticker
117
117
protected:
118
118
static void _static_callback (void * arg);
119
119
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
+ }
120
124
121
125
ETSTimer* _timer;
122
126
callback_function_t _callback_function = nullptr ;
0 commit comments