diff --git a/src/drivers/px4flow/px4flow.cpp b/src/drivers/px4flow/px4flow.cpp index 4d87d1cfe1..db721afe32 100644 --- a/src/drivers/px4flow/px4flow.cpp +++ b/src/drivers/px4flow/px4flow.cpp @@ -714,7 +714,7 @@ fail: g_dev = nullptr; } - errx(1, "no PX4 FLOW connected"); + errx(1, "no PX4FLOW connected over I2C"); } /** diff --git a/src/modules/fw_att_control/fw_att_control_main.cpp b/src/modules/fw_att_control/fw_att_control_main.cpp index fb6f74f357..cb17728948 100644 --- a/src/modules/fw_att_control/fw_att_control_main.cpp +++ b/src/modules/fw_att_control/fw_att_control_main.cpp @@ -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); } diff --git a/src/modules/land_detector/land_detector_main.cpp b/src/modules/land_detector/land_detector_main.cpp index 09b5fd799b..82f890b5f7 100644 --- a/src/modules/land_detector/land_detector_main.cpp +++ b/src/modules/land_detector/land_detector_main.cpp @@ -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); diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index b12003447a..9f5a11f94b 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -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. */ diff --git a/src/modules/position_estimator_inav/position_estimator_inav_main.c b/src/modules/position_estimator_inav/position_estimator_inav_main.c index 5660bcc194..9dc7999099 100644 --- a/src/modules/position_estimator_inav/position_estimator_inav_main.c +++ b/src/modules/position_estimator_inav/position_estimator_inav_main.c @@ -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; } diff --git a/src/platforms/common/px4_getopt.c b/src/platforms/common/px4_getopt.c index 5f76065bb0..d7d03ed49f 100644 --- a/src/platforms/common/px4_getopt.c +++ b/src/platforms/common/px4_getopt.c @@ -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.