GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_timer Struct Reference

A timer. More...

#include <gp_timer.h>

Collaboration diagram for gp_timer:

Data Fields

uint64_t expires
 
const char * id
 
uint32_t period
 
uint32_t running:1
 
uint32_t in_callback:1
 
uint32_t res_in_callback:1
 
void * _priv
 Library private pointer. Do not touch!
 
uint32_t(* callback )(struct gp_timer *self)
 Timer callback.
 
void * priv
 
void(* stopped )(gp_timer *self)
 An optional function to cleanup when timer is stopped.
 

Detailed Description

A timer.

Definition at line 26 of file gp_timer.h.

Field Documentation

◆ callback

uint32_t(* gp_timer::callback) (struct gp_timer *self)

Timer callback.

Unless GP_TIMER_STOP is returned the timer is rescheduled to expire return value from now.

Definition at line 57 of file gp_timer.h.

◆ expires

uint64_t gp_timer::expires

Expiration time, set by user, modified by the queue

Definition at line 33 of file gp_timer.h.

◆ id

const char* gp_timer::id

Timer name showed in debug messages

Definition at line 36 of file gp_timer.h.

◆ in_callback

uint32_t gp_timer::in_callback

Set during the run of the timer callback

Definition at line 44 of file gp_timer.h.

◆ period

uint32_t gp_timer::period

User variable may be used to store the timer period

Definition at line 39 of file gp_timer.h.

◆ priv

void* gp_timer::priv

A user private pointer

Definition at line 60 of file gp_timer.h.

◆ res_in_callback

uint32_t gp_timer::res_in_callback

Set if timer was rescheduled from callback

Definition at line 46 of file gp_timer.h.

◆ running

uint32_t gp_timer::running

Set if timer is inserted into a queue

Definition at line 42 of file gp_timer.h.

Referenced by gp_timer_is_running().

◆ stopped

void(* gp_timer::stopped) (gp_timer *self)

An optional function to cleanup when timer is stopped.

When non-NULL this function is called when timer is stopped. Timer can be either stopped when gp_timer::callback returns GP_TIMER_STOP or when a timer was removed from the queue.

It is safe to free dynamically alocated timers from this callback.

Definition at line 71 of file gp_timer.h.


The documentation for this struct was generated from the following file: