Merge pull request #4184 from geky/events-strict-alias-warning

events: Remove strict-aliasing warning
pull/4224/head
Anna Bridge 2017-04-20 16:43:13 +01:00 committed by GitHub
commit 2ae34c45d0
1 changed files with 4 additions and 5 deletions

View File

@ -42,13 +42,12 @@ static void equeue_tick_init() {
"The equeue_timer buffer must fit the class Timer");
MBED_STATIC_ASSERT(sizeof(equeue_ticker) >= sizeof(Ticker),
"The equeue_ticker buffer must fit the class Ticker");
new (equeue_timer) Timer;
new (equeue_ticker) Ticker;
Timer *timer = new (equeue_timer) Timer;
Ticker *ticker = new (equeue_ticker) Ticker;
equeue_minutes = 0;
reinterpret_cast<Timer*>(equeue_timer)->start();
reinterpret_cast<Ticker*>(equeue_ticker)
->attach_us(equeue_tick_update, 1000 << 16);
timer->start();
ticker->attach_us(equeue_tick_update, 1000 << 16);
equeue_tick_inited = true;
}