Redo timer math for spurrious events
The timer event sometimes comes late and causes a bunch of issues. Do
all the expired timer math ourselves instead.
Change-Id: Ie6b438140dc16e1eb9aede3b4f0265f3ae725343
diff --git a/aos/events/event_loop_tmpl.h b/aos/events/event_loop_tmpl.h
index dfb5a6d..1daf88c 100644
--- a/aos/events/event_loop_tmpl.h
+++ b/aos/events/event_loop_tmpl.h
@@ -100,7 +100,7 @@
return false;
}
-inline void TimerHandler::Call(
+inline monotonic_clock::time_point TimerHandler::Call(
std::function<monotonic_clock::time_point()> get_time,
monotonic_clock::time_point event_time) {
CHECK_NOTNULL(timing_.timer);
@@ -131,6 +131,7 @@
monotonic_end_time - monotonic_start_time)
.count();
timing_.handler_time.Add(handler_latency);
+ return monotonic_start_time;
}
inline void PhasedLoopHandler::Call(