Replacing usleep with px4_usleep

This is a step towards isolating time from the system.
This commit is contained in:
Julian Oes
2018-12-22 10:32:18 +01:00
parent e485885344
commit 5b9dea5604
112 changed files with 339 additions and 305 deletions
@@ -121,7 +121,7 @@ int do_airspeed_calibration(orb_advert_t *mavlink_log_pub)
}
calibration_log_critical(mavlink_log_pub, "[cal] Ensure sensor is not measuring wind");
usleep(500 * 1000);
px4_usleep(500 * 1000);
while (calibration_counter < calibration_count) {
@@ -198,7 +198,7 @@ int do_airspeed_calibration(orb_advert_t *mavlink_log_pub)
calibration_log_info(mavlink_log_pub, "[cal] Offset of %d Pascal", (int)diff_pres_offset);
/* wait 500 ms to ensure parameter propagated through the system */
usleep(500 * 1000);
px4_usleep(500 * 1000);
calibration_log_critical(mavlink_log_pub, "[cal] Blow across front of pitot without touching");
@@ -277,7 +277,7 @@ int do_airspeed_calibration(orb_advert_t *mavlink_log_pub)
/* Wait 2sec for the airflow to stop and ensure the driver filter has caught up, otherwise
* the followup preflight checks might fail. */
usleep(2e6);
px4_usleep(2e6);
normal_return:
calibrate_cancel_unsubscribe(cancel_sub);