machinarium: add simplified mm_timer_start()
@@ -27,7 +27,19 @@ mm_timer_t*
mm_clock_timer_min(mm_clock_t*);
static inline void
-mm_timer_stop(mm_timer_t *timer) {
+mm_timer_start(mm_clock_t *clock,
+ mm_timer_t *timer,
+ mm_timer_callback_t cb, void *arg, int interval)
+{
+ if (interval == 0)
+ return;
+ mm_timer_init(timer, cb, arg, interval);
+ mm_clock_timer_add(clock, timer);
+}
+
+static inline void
+mm_timer_stop(mm_timer_t *timer)
+{
if (! timer->active)
return;
mm_clock_timer_del(timer->clock, timer);
