ao_timer.h
Timers

Notes

  • software timer based on alarms
  • can restart automatically, if a finite period is specified.
  • callback executed in the context of the alarm interrupt.

Include

ao_alarm.h
ao_func.h
ao_time.h

Types

ao_timer_t

typedef struct ao_timer_t ao_timer_t;

Represents a timer.

Structs

ao_timer_t

struct ao_timer_t
{
    ao_alarm_t alarm;
    ao_proc_t  callback;
    void *     callback_parameter;
    ao_time_t  end;
    ao_time_t  period;
};
alarm The alarm.
callback The callback.
callback_parameter The callback parameter.
end The next time point of expiration.
period The period.

Functions

ao_timer_start

ao_timer_start_from

void ao_timer_start     (ao_timer_t * t, ao_time_t phase, ao_time_t period);
void ao_timer_start_from(ao_timer_t * t, ao_time_t phase, ao_time_t period, ao_time_t beginning);

Starts a timer with a phase, a period, and an optional beginning.

ao_timer_stop

void ao_timer_stop(ao_timer_t * t);

Stops a timer.