@@ -32,7 +32,7 @@ class Ticker
32
32
Ticker ();
33
33
~Ticker ();
34
34
35
- typedef void (*callback_with_arg_t )(void *);
35
+ typedef void (*callback_with_arg_t )(void *);
36
36
typedef std::function<void (void )> callback_function_t ;
37
37
38
38
void attach_scheduled (float seconds, callback_function_t callback)
@@ -64,14 +64,14 @@ class Ticker
64
64
// C-cast serves two purposes:
65
65
// static_cast for smaller integer types,
66
66
// reinterpret_cast + const_cast for pointer types
67
- _attach_s (seconds, true , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
67
+ _attach_s (seconds, true , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
68
68
}
69
69
70
70
template <typename TArg>
71
71
void attach_ms (uint32_t milliseconds, void (*callback)(TArg), TArg arg)
72
72
{
73
73
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
74
- _attach_ms (milliseconds, true , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
74
+ _attach_ms (milliseconds, true , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
75
75
}
76
76
77
77
void once_scheduled (float seconds, callback_function_t callback)
@@ -100,14 +100,14 @@ class Ticker
100
100
void once (float seconds, void (*callback)(TArg), TArg arg)
101
101
{
102
102
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
103
- _attach_s (seconds, false , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
103
+ _attach_s (seconds, false , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
104
104
}
105
105
106
106
template <typename TArg>
107
107
void once_ms (uint32_t milliseconds, void (*callback)(TArg), TArg arg)
108
108
{
109
109
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
110
- _attach_ms (milliseconds, false , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
110
+ _attach_ms (milliseconds, false , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
111
111
}
112
112
113
113
void detach ();
@@ -122,7 +122,6 @@ class Ticker
122
122
123
123
private:
124
124
void _attach_s (float seconds, bool repeat, callback_with_arg_t callback, void * arg);
125
- // char _etsTimerMem[sizeof(ETSTimer)];
126
125
ETSTimer _etsTimer;
127
126
};
128
127
0 commit comments