Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
sys_time.c File Reference

Architecture independent timing functions. More...

#include "mcu_periph/sys_time.h"
#include "mcu.h"
#include "limits.h"
+ Include dependency graph for sys_time.c:

Go to the source code of this file.

Functions

tid_t sys_time_register_timer (float duration, sys_time_cb cb)
 Register a new system timer. More...
 
void sys_time_cancel_timer (tid_t id)
 Cancel a system timer by id. More...
 
void sys_time_update_timer (tid_t id, float duration)
 Update the duration until a timer elapses. More...
 
void sys_time_init (void)
 

Variables

struct sys_time sys_time
 

Detailed Description

Architecture independent timing functions.

Definition in file sys_time.c.

Function Documentation

void sys_time_cancel_timer ( tid_t  id)

Cancel a system timer by id.

Parameters
idTimer id.

Definition at line 60 of file sys_time.c.

References sys_time_timer::cb, sys_time_timer::duration, sys_time_timer::elapsed, sys_time_timer::end_time, sys_time_timer::in_use, and sys_time::timer.

Referenced by mavlink_mission_cancel_timer(), and px4flash_event().

+ Here is the caller graph for this function:

void sys_time_init ( void  )
tid_t sys_time_register_timer ( float  duration,
sys_time_cb  cb 
)

Register a new system timer.

Parameters
durationDuration in seconds until the timer elapses.
cbCallback function that is called from the ISR when timer elapses, or NULL
Returns
-1 if it failed, the timer id otherwise

Definition at line 43 of file sys_time.c.

References sys_time_timer::cb, sys_time_timer::duration, sys_time_timer::elapsed, sys_time_timer::end_time, sys_time_timer::in_use, sys_time::nb_tick, start_time, SYS_TIME_NB_TIMER, sys_time_ticks_of_sec(), and sys_time::timer.

Referenced by init_ap(), init_fbw(), intermcu_init(), main(), main_init(), mavlink_mission_set_timer(), px4flash_event(), and px4flash_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void sys_time_update_timer ( tid_t  id,
float  duration 
)

Update the duration until a timer elapses.

Parameters
idTimer id
durationDuration in seconds until the timer elapses.

Definition at line 70 of file sys_time.c.

References sys_time_timer::duration, sys_time_timer::end_time, mcu_int_disable, mcu_int_enable, sys_time_ticks_of_sec(), and sys_time::timer.

Referenced by mavlink_mission_set_timer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

Definition at line 41 of file sys_time.c.