Browse Source

ArduCopter: Ensure update_GPS does nothing when gps is disabled.

This fixes a bug in which an APM without a GPS would not work because it would constantly scan for a valid GPS long after it should have given up and moved on.
master
rmackay9 13 years ago
parent
commit
72d76558a7
  1. 5
      ArduCopter/ArduCopter.pde

5
ArduCopter/ArduCopter.pde

@ -1331,6 +1331,11 @@ static void update_GPS(void) @@ -1331,6 +1331,11 @@ static void update_GPS(void)
// A counter that is used to grab at least 10 reads before commiting the Home location
static byte ground_start_count = 10;
// return immediately if GPS is not enabled
if( !GPS_enabled ) {
return;
}
g_gps->update();
update_GPS_light();

Loading…
Cancel
Save