Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Implementation of system time functions for ChibiOS arch. More...
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_usec100 (void) |
Get the time in microseconds divided by 100 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) |
Variables | |
static uint32_t | cpu_ticks = 0 |
static uint32_t | cpu_counter = 0 |
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.
uint32_t get_sys_time_msec | ( | void | ) |
Get the time in milliseconds since startup.
Definition at line 98 of file sys_time_arch.c.
References cpu_counter, sys_time::nb_sec, sys_time::nb_sec_rem, and STM32_SYSCLK.
Referenced by ak8975_event(), ak8975_read(), approach_moving_target_enable(), bf_millis(), collective_tracking_control(), dc_ctrl_parrot_mykonos_command(), dc_ctrl_parrot_mykonos_periodic(), distributed_circular(), follow_me_parse_target_pos(), follow_me_set_wp(), gps_piksi_event(), gvf_control_2D(), gvf_parametric_control_2D(), hackhd_command(), hackhd_periodic(), init_random(), mavlink_send_attitude(), mavlink_send_attitude_quaternion(), mavlink_send_global_position_int(), mavlink_send_highres_imu(), mavlink_send_local_position_ned(), mavlink_send_rc_channels(), mavlink_send_set_mode(), mavlink_send_system_time(), parseThetaTable(), periodic_2Hz_openlog(), sbp_pos_ecef_callback(), sbus_common_decode_event(), send_bluegiga(), send_downlink(), send_gvf(), send_gvf_parametric(), spb_heartbeat_callback(), spektrum_init_sat(), spektrum_uart_check(), target_get_pos(), target_get_vel(), target_parse_target_pos(), target_pos_set_current_offset(), tunnel_event(), and wind_estimator_periodic().
uint32_t get_sys_time_usec | ( | void | ) |
Get the time in microseconds since startup.
WARNING: overflows after 70min!
Definition at line 71 of file sys_time_arch.c.
References cpu_counter, sys_time::nb_sec, sys_time::nb_sec_rem, and STM32_SYSCLK.
Referenced by ahrs_aligner_run(), 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_scp_event(), baro_sim_periodic(), bf_micros(), cloud_sensor_callback(), cloud_sim_detect(), decode_optical_flow_msg(), ekf_aw_get_health(), gps_cb(), gps_datalink_publish(), gps_feed_value(), gps_intermcu_parse_IMCU_REMOTE_GPS(), gps_mtk_msg(), gps_piksi_publish(), gps_sim_publish(), gps_sirf_msg(), gps_skytraq_msg(), gps_ubx_msg(), gps_ubx_parse_nav_relposned(), gps_udp_parse(), handle_ins_msg(), hott_periodic_event(), imu_apogee_event(), imu_aspirin2_event(), imu_aspirin_event(), imu_aspirin_i2c_event(), imu_bebop_event(), imu_bmi088_event(), imu_cube_event(), imu_disco_event(), imu_heater_run(), imu_mpu9250_event(), imu_mpu_hmc_event(), imu_mpu_i2c_event(), imu_mpu_spi_event(), imu_nps_event(), imu_px4_event(), imu_px4fmu_event(), ins_alt_float_update_baro(), ins_alt_float_update_gps(), ins_ekf2_parse_EXTERNAL_POSE(), ins_ext_pose_msg_update(), invensense2_config(), invensense2_parse_data(), invensense3_config(), invensense3_parse_fifo_data(), invensense3_parse_reg_data(), laser_range_array_parse_msg(), lidar_lite_periodic(), lidar_sf11_periodic(), lidar_vl53l5cx_periodic(), lisa_l_baro_event(), LWC_callback(), mag_hmc58xx_module_event(), mag_ist8310_module_event(), mag_lis3mdl_module_event(), mag_pitot_parse_msg(), mag_qmc5883l_module_event(), mag_rm3100_module_event(), main(), mateksys3901l0x_parse(), mavlink_send_gps_global_origin(), mavlink_send_gps_raw_int(), meteo_stick_event(), navdata_publish_imu(), navdata_update(), nmea_gps_msg(), nps_autopilot_run_step(), opticflow_module_run(), opticflow_pmw3901_event(), pose_periodic(), px4flow_i2c_frame_cb(), range_msg_callback(), range_sensor_uavcan_cb(), readRegister_nonblocking(), send_filter_status(), sensors_hitl_event(), sensors_hitl_parse_HITL_AIR_DATA(), sensors_hitl_parse_HITL_GPS(), sonar_adc_read(), sonar_bebop_event(), sonar_pwm_read(), sonar_vl53l1x_publish(), stereocam_parse_msg(), sts3032_event(), superbitrf_event(), superbitrf_receive_packet_cb(), teraranger_event(), tfmini_i2c_periodic(), tfmini_parse(), v4l2_capture_thread(), and video_thread_function().
uint32_t get_sys_time_usec100 | ( | void | ) |
Get the time in microseconds divided by 100 since startup.
Get the time in microseconds since startup.
WARNING: overflows after 7000min!
Definition at line 87 of file sys_time_arch.c.
References cpu_counter, sys_time::nb_sec, sys_time::nb_sec_rem, and STM32_SYSCLK.
Referenced by pprzlog_tp_init().
|
static |
|
static |
Definition at line 154 of file sys_time_arch.c.
References sys_time_timer::cb, CH_CFG_ST_FREQUENCY, cpu_counter, cpu_ticks, cpu_ticks_of_sec(), sys_time_timer::duration, sys_time_timer::elapsed, sys_time_timer::end_time, sys_time_timer::in_use, LED_TOGGLE, sys_time::nb_sec, sys_time::nb_sec_rem, sys_time::nb_tick, SYS_TIME_NB_TIMER, sys_time::timer, and TRUE.
Referenced by nps_autopilot_run_systime_step(), and thd_sys_tick().
void sys_time_arch_init | ( | void | ) |
Definition at line 52 of file sys_time_arch.c.
References CH_CFG_ST_FREQUENCY, sys_time::cpu_ticks_per_sec, sys_time::resolution, sys_time::resolution_cpu_ticks, and thd_sys_tick().
Referenced by sys_time_init().
void sys_time_msleep | ( | uint16_t | ms | ) |
Definition at line 128 of file sys_time_arch.c.
void sys_time_ssleep | ( | uint8_t | s | ) |
Definition at line 133 of file sys_time_arch.c.
References s.
void 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 116 of file sys_time_arch.c.
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().
|
static |
Definition at line 142 of file sys_time_arch.c.
References sys_tick_handler(), SYS_TIME_FREQUENCY, TRUE, and USEC_OF_SEC.
Referenced by sys_time_arch_init().
|
static |
|
static |
Definition at line 50 of file sys_time_arch.c.
Referenced by get_sys_time_msec(), get_sys_time_usec(), get_sys_time_usec100(), and sys_tick_handler().
|
static |
Definition at line 49 of file sys_time_arch.c.
Referenced by msec_of_cpu_ticks(), nsec_of_cpu_ticks(), sys_tick_handler(), and usec_of_cpu_ticks().