Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
sys_time_arch.c File Reference
#include "mcu_periph/sys_time_arch.h"
#include <BOARD_CONFIG>
#include <ch.h>
#include "led.h"
+ Include dependency graph for sys_time_arch.c:

Go to the source code of this file.

Functions

static MUTEX_DECL (sys_time_mtx)
 
static void thd_sys_tick (void *arg)
 
static THD_WORKING_AREA (wa_thd_sys_tick, 1024)
 
static void sys_tick_handler (void)
 
void sys_time_arch_init (void)
 
uint32_t get_sys_time_usec (void)
 Get the time in microseconds since startup. More...
 
uint32_t get_sys_time_msec (void)
 Get the time in milliseconds since startup. More...
 
void sys_time_usleep (uint32_t us)
 sys_time_usleep(uint32_t us) More...
 
void sys_time_msleep (uint16_t ms)
 
void sys_time_ssleep (uint8_t s)
 

Detailed Description

Implementation of system time functions for ChibiOS arch

Mostly empty functions for Paparazzi compatibility, since ChibiOS uses different system time functions.

Definition in file sys_time_arch.c.

Function Documentation

◆ get_sys_time_msec()

◆ get_sys_time_usec()

uint32_t get_sys_time_usec ( void  )

Get the time in microseconds since startup.

WARNING: overflows after 70min!

Returns
microseconds since startup as uint32_t

Definition at line 68 of file sys_time_arch.c.

Referenced by ahrs_aligner_run(), ahrs_gx3_publish_imu(), ahrs_vectornav_event(), apogee_baro_event(), ardrone_baro_event(), baro_amsys_read_event(), baro_bmp280_event(), baro_bmp3_event(), baro_bmp_event(), baro_ets_read_event(), baro_event(), baro_hca_read_event(), baro_mpl3115_read_event(), baro_MS5534A_event(), baro_ms5611_event(), baro_periodic(), baro_scp_event(), baro_sim_periodic(), bf_micros(), bmp_baro_event(), decode_optical_flow_msg(), gps_cb(), gps_feed_value(), gps_mtk_msg(), gps_piksi_publish(), gps_sim_hitl_event(), gps_sim_publish(), gps_sirf_msg(), gps_skytraq_msg(), gps_ubx_msg(), gps_udp_parse(), handle_ins_msg(), hott_periodic_event(), imu_analog_periodic(), imu_apogee_event(), imu_aspirin2_event(), imu_aspirin_event(), imu_aspirin_i2c_event(), imu_b2_event(), imu_bebop_event(), imu_bmi088_event(), imu_disco_event(), imu_drotek2_event(), imu_gl1_event(), imu_hbmini_event(), imu_krooz_event(), imu_krooz_periodic(), imu_mpu9250_event(), imu_mpu_hmc_event(), imu_mpu_i2c_event(), imu_mpu_spi_event(), imu_navgo_event(), imu_navstik_event(), imu_nps_event(), imu_ppzuav_event(), imu_px4_event(), imu_px4fmu_event(), imu_swing_event(), imu_um6_publish(), imu_umarim_event(), ins_alt_float_update_baro(), ins_alt_float_update_gps(), intermcu_parse_msg(), laser_range_array_parse_msg(), lidar_lite_periodic(), lidar_sf11_periodic(), lisa_l_baro_event(), mag_hmc58xx_module_event(), mag_ist8310_module_event(), mag_lis3mdl_module_event(), mag_pitot_parse_msg(), main(), mateksys3901l0x_parse(), mavlink_send_gps_raw_int(), meteo_stick_event(), navdata_publish_imu(), navdata_update(), navgo_baro_event(), nmea_gps_msg(), nps_autopilot_run_step(), opticflow_module_run(), opticflow_pmw3901_event(), parse_gps_datalink(), parse_gps_datalink_local(), parse_gps_datalink_small(), pose_periodic(), pprzlog_tp_init(), px4flow_i2c_frame_cb(), range_msg_callback(), readRegister_nonblocking(), send_filter_status(), sonar_adc_read(), sonar_bebop_read(), sonar_pwm_read(), sonar_vl53l1x_publish(), stereocam_parse_msg(), superbitrf_event(), superbitrf_receive_packet_cb(), teraranger_event(), tfmini_i2c_periodic(), tfmini_parse(), umarim_baro_event(), v4l2_capture_thread(), and video_thread_function().

◆ MUTEX_DECL()

static MUTEX_DECL ( sys_time_mtx  )
static

◆ sys_tick_handler()

static void sys_tick_handler ( void  )
static

◆ sys_time_arch_init()

void sys_time_arch_init ( void  )

Definition at line 49 of file sys_time_arch.c.

Referenced by sys_time_init().

+ Here is the caller graph for this function:

◆ sys_time_msleep()

void sys_time_msleep ( uint16_t  ms)

Definition at line 108 of file sys_time_arch.c.

References CH_CFG_ST_FREQUENCY.

◆ sys_time_ssleep()

void sys_time_ssleep ( uint8_t  s)

Definition at line 114 of file sys_time_arch.c.

References s.

◆ sys_time_usleep()

void sys_time_usleep ( uint32_t  us)

sys_time_usleep(uint32_t us)

using intermediate 64 bits variable to avoid wrapping

max sleep time is around 10 days (2^32 / CH_CFG_ST_FREQUENCY) at 10kHz

Definition at line 95 of file sys_time_arch.c.

References CH_CFG_ST_FREQUENCY.

Referenced by bf_delayMicroseconds(), cyrf6936_init(), initializeSensor(), main(), pcap01_init(), px4flash_event(), readRegister_blocking(), received_spektrum_soft_bind(), send_spektrum_bind(), spektrum_bind(), spektrum_try_bind(), VCOM_putchar(), video_thread_function(), w5100_init(), and xbee_dl_init().

+ Here is the caller graph for this function:

◆ thd_sys_tick()

static void thd_sys_tick ( void *  arg)
static

Definition at line 122 of file sys_time_arch.c.

References sys_tick_handler(), and TRUE.

Referenced by sys_time_arch_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ THD_WORKING_AREA()

static THD_WORKING_AREA ( wa_thd_sys_tick  ,
1024   
)
static