mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 12:53:33 +08:00
Replace sleep with px4_sleep
This is another step to isolate time from the system.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user