diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 2dfe3d8e30..e40121eec6 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -101,9 +101,10 @@ then fi fi - if pca8574 start - then - fi + # Currently unused, but might be useful down the road + #if pca8574 start + #then + #fi # # Set default values diff --git a/src/drivers/hil/hil.cpp b/src/drivers/hil/hil.cpp index 0efc490326..1deb131bc3 100644 --- a/src/drivers/hil/hil.cpp +++ b/src/drivers/hil/hil.cpp @@ -347,10 +347,9 @@ HIL::task_main() /* advertise the mixed control outputs */ actuator_outputs_s outputs; memset(&outputs, 0, sizeof(outputs)); - /* advertise the mixed control outputs */ - int dummy; - _t_outputs = orb_advertise_multi(ORB_ID(actuator_outputs), - &outputs, &dummy, ORB_PRIO_LOW); + + /* advertise the mixed control outputs, insist on the first group output */ + _t_outputs = orb_advertise(ORB_ID(actuator_outputs), &outputs); px4_pollfd_struct_t fds[2]; fds[0].fd = _t_actuators; diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index 619922eec8..51cab75538 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -807,6 +807,7 @@ Mavlink::get_free_tx_buf() enable_flow_control(false); } } + #endif return buf_free; @@ -936,6 +937,7 @@ Mavlink::resend_message(mavlink_message_t *msg) _last_write_success_time = _last_write_try_time; count_txbytes(packet_len); } + #endif pthread_mutex_unlock(&_send_mutex); @@ -1016,7 +1018,8 @@ Mavlink::send_statustext(unsigned char severity, const char *string) mavlink_logbuffer_write(&_logbuffer, &logmsg); } -void Mavlink::send_autopilot_capabilites() { +void Mavlink::send_autopilot_capabilites() +{ struct vehicle_status_s status; MavlinkOrbSubscription *status_sub = this->add_orb_subscription(ORB_ID(vehicle_status)); @@ -1039,16 +1042,16 @@ void Mavlink::send_autopilot_capabilites() { memcpy(&msg.flight_custom_version, &px4_git_version_binary, sizeof(msg.flight_custom_version)); memcpy(&msg.middleware_custom_version, &px4_git_version_binary, sizeof(msg.middleware_custom_version)); memset(&msg.os_custom_version, 0, sizeof(msg.os_custom_version)); - #ifdef CONFIG_CDCACM_VENDORID +#ifdef CONFIG_CDCACM_VENDORID msg.vendor_id = CONFIG_CDCACM_VENDORID; - #else +#else msg.vendor_id = 0; - #endif - #ifdef CONFIG_CDCACM_PRODUCTID +#endif +#ifdef CONFIG_CDCACM_PRODUCTID msg.product_id = CONFIG_CDCACM_PRODUCTID; - #else +#else msg.product_id = 0; - #endif +#endif uint32_t uid[3]; mcu_unique_id(uid); msg.uid = (((uint64_t)uid[1]) << 32) | uid[2]; @@ -1349,16 +1352,19 @@ Mavlink::task_main(int argc, char *argv[]) _datarate = 0; _mode = MAVLINK_MODE_NORMAL; -#ifdef __PX4_NUTTX - /* work around some stupidity in task_create's argv handling */ - argc -= 2; - argv += 2; -#endif + /* + * Called via create_task with taskname followed by original argv + * mavlink start + * + * Remove all 3 + */ + argc -= 3; + argv += 3; /* don't exit from getopt loop to leave getopt global variables in consistent state, * set error flag instead */ bool err_flag = false; - int myoptind=1; + int myoptind = 1; const char *myoptarg = NULL; char* eptr; int temp_int_arg; @@ -1412,6 +1418,7 @@ Mavlink::task_main(int argc, char *argv[]) } else if (strcmp(myoptarg, "camera") == 0) { // left in here for compatibility _mode = MAVLINK_MODE_ONBOARD; + } else if (strcmp(myoptarg, "onboard") == 0) { _mode = MAVLINK_MODE_ONBOARD; } @@ -1486,6 +1493,7 @@ Mavlink::task_main(int argc, char *argv[]) warn("could not open %s", _device_name); return ERROR; } + #endif /* initialize send mutex */ @@ -1821,11 +1829,11 @@ Mavlink::start(int argc, char *argv[]) // task - start_helper() only returns // when the started task exits. px4_task_spawn_cmd(buf, - SCHED_DEFAULT, - SCHED_PRIORITY_DEFAULT, - 2400, - (px4_main_t)&Mavlink::start_helper, - (char * const *)argv); + SCHED_DEFAULT, + SCHED_PRIORITY_DEFAULT, + 2400, + (px4_main_t)&Mavlink::start_helper, + (char *const *)argv); // Ensure that this shell command // does not return before the instance @@ -1905,6 +1913,12 @@ Mavlink::stream_command(int argc, char *argv[]) bool provided_device = false; bool provided_network_port = false; + /* + * Called via main with original argv + * mavlink start + * + * Remove 2 + */ argc -= 2; argv += 2;