Sub: fixed startup order of setting mavlink system ID

Set sysid from param before you init the serial port so you always output the intended sysid. Ported the same fix as c01a7718c1
This commit is contained in:
Tom Pittenger 2017-06-08 20:43:07 -07:00 committed by GitHub
parent a960c6526c
commit 51fa76d971
1 changed files with 3 additions and 3 deletions

View File

@ -32,6 +32,9 @@ void Sub::init_ardupilot()
BoardConfig.init();
// identify ourselves correctly with the ground station
mavlink_system.sysid = g.sysid_this_mav;
// initialise serial port
serial_manager.init();
@ -60,9 +63,6 @@ void Sub::init_ardupilot()
gcs_chan[i].setup_uart(serial_manager, AP_SerialManager::SerialProtocol_MAVLink, i);
}
// identify ourselves correctly with the ground station
mavlink_system.sysid = g.sysid_this_mav;
#if LOGGING_ENABLED == ENABLED
log_init();
#endif