8000 Longer delays for Ticker and some internal updates by mcspr · Pull Request #8625 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Longer delays for Ticker and some internal updates #8625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Nov 1, 2022
Prev Previous commit
Next Next commit
syntax
  • Loading branch information
mcspr committed Jul 2, 2022
commit 151c63d90d9ef88d21975e67fa97036b1d052f19
6 changes: 3 additions & 3 deletions libraries/Ticker/src/Ticker.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,23 +202,23 @@ class Ticker
ETSTimer* _timer = nullptr;

private:
struct callback_ptr_t
{
// XXX undefined behaviour? fix next pr
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-function-type"
struct callback_ptr_t
{
template <typename T>
callback_ptr_t(callback_with_typed_arg_t<T> func, T arg) :
func(reinterpret_cast<callback_with_arg_t>(func)),
arg(reinterpret_cast<void*>(arg))
#pragma GCC diagnostic pop
{
static_assert(sizeof(T) <= sizeof(void*), "attach() callback argument size must be <= sizeof(void*)");
}

callback_with_arg_t func = nullptr;
void* arg = nullptr;
};
#pragma GCC diagnostic pop

using callback_data_t = std::variant<
std::monostate,
Expand Down
0