mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 11:03:33 +08:00
Merge pull request #2230 from bansiesta/fix_startup_printfs
Cosmetic startup fixes
This commit is contained in:
@@ -714,7 +714,7 @@ fail:
|
||||
g_dev = nullptr;
|
||||
}
|
||||
|
||||
errx(1, "no PX4 FLOW connected");
|
||||
errx(1, "no PX4FLOW connected over I2C");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -520,7 +520,7 @@ FixedwingAttitudeControl::vehicle_control_mode_poll()
|
||||
orb_check(_vcontrol_mode_sub, &vcontrol_mode_updated);
|
||||
|
||||
if (vcontrol_mode_updated) {
|
||||
|
||||
|
||||
orb_copy(ORB_ID(vehicle_control_mode), _vcontrol_mode_sub, &_vcontrol_mode);
|
||||
}
|
||||
}
|
||||
@@ -619,11 +619,6 @@ FixedwingAttitudeControl::task_main_trampoline(int argc, char *argv[])
|
||||
void
|
||||
FixedwingAttitudeControl::task_main()
|
||||
{
|
||||
|
||||
/* inform about start */
|
||||
warnx("Initializing..");
|
||||
fflush(stdout);
|
||||
|
||||
/*
|
||||
* do subscriptions
|
||||
*/
|
||||
@@ -1154,14 +1149,17 @@ int fw_att_control_main(int argc, char *argv[])
|
||||
err(1, "start failed");
|
||||
}
|
||||
|
||||
/* avoid memory fragmentation by not exiting start handler until the task has fully started */
|
||||
while (att_control::g_control == nullptr || !att_control::g_control->task_running()) {
|
||||
usleep(50000);
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
}
|
||||
printf("\n");
|
||||
/* check if the waiting is necessary at all */
|
||||
if (att_control::g_control == nullptr || !att_control::g_control->task_running()) {
|
||||
|
||||
/* avoid memory fragmentation by not exiting start handler until the task has fully started */
|
||||
while (att_control::g_control == nullptr || !att_control::g_control->task_running()) {
|
||||
usleep(50000);
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -151,20 +151,26 @@ static int land_detector_start(const char *mode)
|
||||
/* 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
|
||||
|
||||
while (!land_detector_task->isRunning()) {
|
||||
usleep(50000);
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
/* avoid printing dots just yet and do one sleep before the first check */
|
||||
usleep(10000);
|
||||
|
||||
if (hrt_absolute_time() > timeout) {
|
||||
err(1, "start failed - timeout");
|
||||
land_detector_stop();
|
||||
exit(1);
|
||||
/* check if the waiting involving dots and a newline are still needed */
|
||||
if (!land_detector_task->isRunning()) {
|
||||
while (!land_detector_task->isRunning()) {
|
||||
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
usleep(50000);
|
||||
|
||||
if (hrt_absolute_time() > timeout) {
|
||||
err(1, "start failed - timeout");
|
||||
land_detector_stop();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
//Remember current active mode
|
||||
strncpy(_currentMode, mode, 12);
|
||||
|
||||
|
||||
@@ -777,7 +777,7 @@ Mavlink::get_free_tx_buf()
|
||||
if (_last_write_try_time != 0 &&
|
||||
hrt_elapsed_time(&_last_write_success_time) > 500 * 1000UL &&
|
||||
_last_write_success_time != _last_write_try_time) {
|
||||
warnx("DISABLING HARDWARE FLOW CONTROL");
|
||||
warnx("Disabling hardware flow control");
|
||||
enable_flow_control(false);
|
||||
}
|
||||
}
|
||||
@@ -913,7 +913,7 @@ Mavlink::handle_message(const mavlink_message_t *msg)
|
||||
|
||||
/* handle packet with parameter component */
|
||||
_parameters_manager->handle_message(msg);
|
||||
|
||||
|
||||
/* handle packet with ftp component */
|
||||
_mavlink_ftp->handle_message(msg);
|
||||
|
||||
@@ -1468,7 +1468,7 @@ Mavlink::task_main(int argc, char *argv[])
|
||||
_mavlink_ftp = (MavlinkFTP *) MavlinkFTP::new_instance(this);
|
||||
_mavlink_ftp->set_interval(interval_from_rate(80.0f));
|
||||
LL_APPEND(_streams, _mavlink_ftp);
|
||||
|
||||
|
||||
/* MISSION_STREAM stream, actually sends all MISSION_XXX messages at some rate depending on
|
||||
* remote requests rate. Rate specified here controls how much bandwidth we will reserve for
|
||||
* mission messages. */
|
||||
|
||||
@@ -389,8 +389,8 @@ int position_estimator_inav_thread_main(int argc, char *argv[])
|
||||
} else {
|
||||
wait_baro = false;
|
||||
baro_offset /= (float) baro_init_cnt;
|
||||
warnx("baro offs: %d", (int)baro_offset);
|
||||
mavlink_log_info(mavlink_fd, "[inav] baro offs: %d", (int)baro_offset);
|
||||
warnx("baro offset: %d m", (int)baro_offset);
|
||||
mavlink_log_info(mavlink_fd, "[inav] baro offset: %d m", (int)baro_offset);
|
||||
local_pos.z_valid = true;
|
||||
local_pos.v_z_valid = true;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ static int reorder(int argc, char **argv, const char *options)
|
||||
tmpidx++;
|
||||
if (takesarg) {
|
||||
tmp_argv[tmpidx] = argv[idx+1];
|
||||
printf("tmp_argv[%d] = %s\n", tmpidx, tmp_argv[tmpidx]);
|
||||
// printf("tmp_argv[%d] = %s\n", tmpidx, tmp_argv[tmpidx]);
|
||||
tmpidx++;
|
||||
idx++;
|
||||
}
|
||||
@@ -108,11 +108,11 @@ static int reorder(int argc, char **argv, const char *options)
|
||||
}
|
||||
|
||||
//
|
||||
// px4_getopt
|
||||
// px4_getopt
|
||||
//
|
||||
// returns:
|
||||
// the valid option character
|
||||
// '?' if any option is unknown
|
||||
// '?' if any option is unknown
|
||||
// -1 if no remaining options
|
||||
//
|
||||
// If the option takes an arg, myoptarg will be updated accordingly.
|
||||
|
||||
Reference in New Issue
Block a user