mirror of https://github.com/ArduPilot/ardupilot
Merge branch 'master' of https://code.google.com/p/ardupilot-mega
This commit is contained in:
commit
13ca48f744
|
@ -88,6 +88,8 @@ static void zero_airspeed(void)
|
|||
|
||||
}
|
||||
|
||||
#endif // HIL_MODE != HIL_MODE_ATTITUDE
|
||||
|
||||
static void init_compass()
|
||||
{
|
||||
compass.set_orientation(MAG_ORIENTATION); // set compass's orientation on aircraft
|
||||
|
@ -110,8 +112,6 @@ static void init_optflow()
|
|||
#endif
|
||||
}
|
||||
|
||||
#endif // HIL_MODE != HIL_MODE_ATTITUDE
|
||||
|
||||
static void read_battery(void)
|
||||
{
|
||||
battery_voltage1 = BATTERY_VOLTAGE(analogRead(BATTERY_PIN1)) * .1 + battery_voltage1 * .9;
|
||||
|
|
|
@ -99,6 +99,7 @@ AP_GPS_Auto::_detect(void)
|
|||
unsigned long then;
|
||||
int fingerprint[4];
|
||||
int tries;
|
||||
int charcount;
|
||||
GPS *gps;
|
||||
|
||||
//
|
||||
|
@ -114,15 +115,16 @@ AP_GPS_Auto::_detect(void)
|
|||
// XXX We can detect babble by counting incoming characters, but
|
||||
// what would we do about it?
|
||||
//
|
||||
charcount = 0;
|
||||
_port->flush();
|
||||
then = millis();
|
||||
do {
|
||||
callback(1);
|
||||
if (_port->available()) {
|
||||
then = millis();
|
||||
_port->read();
|
||||
charcount++;
|
||||
}
|
||||
} while ((millis() - then) < 50);
|
||||
} while ((millis() - then) < 50 && charcount < 5000);
|
||||
|
||||
//
|
||||
// Collect four characters to fingerprint a device
|
||||
|
|
Loading…
Reference in New Issue