Replace sleep with px4_sleep

This is another step to isolate time from the system.
This commit is contained in:
Julian Oes
2018-12-22 10:32:18 +01:00
parent 3f695870a4
commit d70b0f1c8c
13 changed files with 20 additions and 15 deletions
@@ -840,7 +840,7 @@ int do_level_calibration(orb_advert_t *mavlink_log_pub)
while (hrt_elapsed_time(&start) < settle_time * 1000000) {
calibration_log_info(mavlink_log_pub, CAL_QGC_PROGRESS_MSG,
(int)(90 * hrt_elapsed_time(&start) / 1e6f / (float)settle_time));
sleep(settle_time / 10);
px4_sleep(settle_time / 10);
}
start = hrt_absolute_time();
@@ -60,7 +60,7 @@ static const char *sensor_name = "airspeed";
static void feedback_calibration_failed(orb_advert_t *mavlink_log_pub)
{
sleep(5);
px4_sleep(5);
calibration_log_critical(mavlink_log_pub, CAL_QGC_FAILED_MSG, sensor_name);
}
@@ -284,7 +284,7 @@ normal_return:
px4_close(diff_pres_sub);
// This give a chance for the log messages to go out of the queue before someone else stomps on then
sleep(1);
px4_sleep(1);
return result;
+1 -1
View File
@@ -223,7 +223,7 @@ int rc_calibration_check(orb_advert_t *mavlink_log_pub, bool report_fail, bool i
}
if (channels_failed) {
sleep(2);
px4_sleep(2);
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "%d config error%s for %d RC channel%s.",