@@ -45,13 +45,13 @@ class Ticker
45
45
_attach_s (seconds, true , _static_callback, this );
46
46
}
47
47
48
- void attach_ms (uint32_t milliseconds, callback_function_t callback)
48
+ void attach_ms (uint64_t milliseconds, callback_function_t callback)
49
49
{
50
50
_callback_function = std::move (callback);
51
51
_attach_ms (milliseconds, true , _static_callback, this );
52
52
}
53
53
54
- void attach_us (uint32_t micros, callback_function_t callback)
54
+ void attach_us (uint64_t micros, callback_function_t callback)
55
55
{
56
56
_callback_function = std::move (callback);
57
57
_attach_us (micros, true , _static_callback, this );
@@ -68,14 +68,14 @@ class Ticker
68
68
}
69
69
70
70
template <typename TArg>
71
- void attach_ms (uint32_t milliseconds, void (*callback)(TArg), TArg arg)
71
+ void attach_ms (uint64_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
74
_attach_ms (milliseconds, true , reinterpret_cast <callback_with_arg_t >(callback), (void *)arg);
75
75
}
76
76
77
77
template <typename TArg>
78
- void attach_us (uint32_t micros, void (*callback)(TArg), TArg arg)
78
+ void attach_us (uint64_t micros, void (*callback)(TArg), TArg arg)
79
79
{
80
80
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
81
81
_attach_us (micros, true , reinterpret_cast <callback_with_arg_t >(callback), (void *)arg);
@@ -87,13 +87,13 @@ class Ticker
87
87
_attach_s (seconds, false , _static_callback, this );
88
88
}
89
89
90
- void once_ms (uint32_t milliseconds, callback_function_t callback)
90
+ void once_ms (uint64_t milliseconds, callback_function_t callback)
91
91
{
92
92
_callback_function = std::move (callback);
93
93
_attach_ms (milliseconds, false , _static_callback, this );
94
94
}
95
95
96
- void once_us (uint32_t micros, callback_function_t callback)
96
+ void once_us (uint64_t micros, callback_function_t callback)
97
97
{
98
98
_callback_function = std::move (callback);
99
99
_attach_us (micros, false , _static_callback, this );
@@ -107,14 +107,14 @@ class Ticker
107
107
}
108
108
109
109
template <typename TArg>
110
- void once_ms (uint32_t milliseconds, void (*callback)(TArg), TArg arg)
110
+ void once_ms (uint64_t milliseconds, void (*callback)(TArg), TArg arg)
111
111
{
112
112
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
113
113
_attach_ms (milliseconds, false , reinterpret_cast <callback_with_arg_t >(callback), (void *)arg);
114
114
}
115
115
116
116
template <typename TArg>
117
- void once_us (uint32_t micros, void (*callback)(TArg), TArg arg)
117
+ void once_us (uint64_t micros, void (*callback)(TArg), TArg arg)
118
118
{
119
119
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
120
120
_attach_us (micros, false , reinterpret_cast <callback_with_arg_t >(callback), (void *)arg);
@@ -124,15 +124,15 @@ class Ticker
124
124
bool active () const ;
125
125
126
126
protected:
127
- void _attach_ms (uint32_t milliseconds, bool repeat, callback_with_arg_t callback, void * arg);
127
+ void _attach_ms (uint64_t milliseconds, bool repeat, callback_with_arg_t callback, void * arg);
128
128
static void _static_callback (void * arg);
129
129
130
130
callback_function_t _callback_function = nullptr ;
131
131
132
132
esp_timer_handle_t _timer;
133
133
134
134
private:
135
- void _attach_us (uint32_t micros, bool repeat, callback_with_arg_t callback, void * arg);
135
+ void _attach_us (uint64_t micros, bool repeat, callback_with_arg_t callback, void * arg);
136
136
void _attach_s (float seconds, bool repeat, callback_with_arg_t callback, void * arg);
137
137
};
138
138
0 commit comments