|
|
|
@ -113,12 +113,18 @@ void Plane::init_ardupilot()
@@ -113,12 +113,18 @@ void Plane::init_ardupilot()
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
BoardConfig.init(); |
|
|
|
|
GCS_MAVLINK::set_dataflash(&DataFlash); |
|
|
|
|
|
|
|
|
|
// initialise serial ports
|
|
|
|
|
serial_manager.init(); |
|
|
|
|
gcs[0].setup_uart(serial_manager, AP_SerialManager::SerialProtocol_MAVLink, 0); |
|
|
|
|
|
|
|
|
|
GCS_MAVLINK::set_dataflash(&DataFlash); |
|
|
|
|
// Register mavlink_delay_cb, which will run anytime you have
|
|
|
|
|
// more than 5ms remaining in your call to hal.scheduler->delay
|
|
|
|
|
hal.scheduler->register_delay_callback(mavlink_delay_cb_static, 5); |
|
|
|
|
|
|
|
|
|
// setup any board specific drivers
|
|
|
|
|
BoardConfig.init(); |
|
|
|
|
|
|
|
|
|
// allow servo set on all channels except first 4
|
|
|
|
|
ServoRelayEvents.set_channel_mask(0xFFF0); |
|
|
|
@ -144,7 +150,7 @@ void Plane::init_ardupilot()
@@ -144,7 +150,7 @@ void Plane::init_ardupilot()
|
|
|
|
|
check_usb_mux(); |
|
|
|
|
|
|
|
|
|
// setup telem slots with serial ports
|
|
|
|
|
for (uint8_t i = 0; i < MAVLINK_COMM_NUM_BUFFERS; i++) { |
|
|
|
|
for (uint8_t i = 1; i < MAVLINK_COMM_NUM_BUFFERS; i++) { |
|
|
|
|
gcs[i].setup_uart(serial_manager, AP_SerialManager::SerialProtocol_MAVLink, i); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -184,10 +190,6 @@ void Plane::init_ardupilot()
@@ -184,10 +190,6 @@ void Plane::init_ardupilot()
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// Register mavlink_delay_cb, which will run anytime you have
|
|
|
|
|
// more than 5ms remaining in your call to hal.scheduler->delay
|
|
|
|
|
hal.scheduler->register_delay_callback(mavlink_delay_cb_static, 5); |
|
|
|
|
|
|
|
|
|
// give AHRS the airspeed sensor
|
|
|
|
|
ahrs.set_airspeed(&airspeed); |
|
|
|
|
|
|
|
|
|