mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-25 18:18:49 -04:00
Add a delay after sending the GPS mode switch strings in an attempt to give any NMEA data time to drain before we attempt to sniff again.
Otherwise, we can end up settling on NMEA as a mode just after switching a SiRF GPS to binary mode. git-svn-id: https://arducopter.googlecode.com/svn/trunk@1467 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
parent
0b2e2c55f9
commit
3ac2193d48
@ -68,7 +68,7 @@ AP_GPS_Auto::_detect(void)
|
||||
GPS *gps;
|
||||
|
||||
//
|
||||
// Loop attempting to detect a recognised GPS
|
||||
// Loop attempting to detect a recognized GPS
|
||||
//
|
||||
gps = NULL;
|
||||
for (tries = 0; tries < 2; tries++) {
|
||||
@ -104,7 +104,7 @@ AP_GPS_Auto::_detect(void)
|
||||
fingerprint[3]);
|
||||
|
||||
//
|
||||
// u-blox or MTK in DIYD binary mode (whose smart idea was
|
||||
// ublox or MTK in DIYD binary mode (whose smart idea was
|
||||
// it to make the MTK look sort-of like it was talking UBX?)
|
||||
//
|
||||
if ((0xb5 == fingerprint[0]) &&
|
||||
@ -118,8 +118,8 @@ AP_GPS_Auto::_detect(void)
|
||||
break;
|
||||
}
|
||||
|
||||
// any other message is u-blox
|
||||
Serial.printf("detected u-blox in binary mode\n");
|
||||
// any other message is ublox
|
||||
Serial.printf("detected ublox in binary mode\n");
|
||||
gps = new AP_GPS_UBLOX(_port);
|
||||
break;
|
||||
}
|
||||
@ -154,6 +154,9 @@ AP_GPS_Auto::_detect(void)
|
||||
_port->println(MTK_SET_BINARY);
|
||||
_port->println(UBLOX_SET_BINARY);
|
||||
_port->println(SIRF_SET_BINARY);
|
||||
|
||||
// give the GPS time to react to the settings
|
||||
delay(100);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user