forked from Archive/PX4-Autopilot
land_detector: get rid of one dot at a time
This commit is contained in:
parent
1734b97635
commit
11f80ceb64
|
@ -151,10 +151,16 @@ static int land_detector_start(const char *mode)
|
||||||
/* avoid memory fragmentation by not exiting start handler until the task has fully started */
|
/* avoid memory fragmentation by not exiting start handler until the task has fully started */
|
||||||
const uint32_t timeout = hrt_absolute_time() + 5000000; //5 second timeout
|
const uint32_t timeout = hrt_absolute_time() + 5000000; //5 second timeout
|
||||||
|
|
||||||
|
/* avoid printing dots just yet and do one sleep before the first check */
|
||||||
|
usleep(10000);
|
||||||
|
|
||||||
|
/* check if the waiting involving dots and a newline are still needed */
|
||||||
|
if (!land_detector_task->isRunning()) {
|
||||||
while (!land_detector_task->isRunning()) {
|
while (!land_detector_task->isRunning()) {
|
||||||
usleep(50000);
|
|
||||||
printf(".");
|
printf(".");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
usleep(50000);
|
||||||
|
|
||||||
if (hrt_absolute_time() > timeout) {
|
if (hrt_absolute_time() > timeout) {
|
||||||
err(1, "start failed - timeout");
|
err(1, "start failed - timeout");
|
||||||
|
@ -162,8 +168,8 @@ static int land_detector_start(const char *mode)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
//Remember current active mode
|
//Remember current active mode
|
||||||
strncpy(_currentMode, mode, 12);
|
strncpy(_currentMode, mode, 12);
|
||||||
|
|
Loading…
Reference in New Issue