mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-10 15:19:25 +00:00
free serial pins if gps_disabled is set
This commit is contained in:
parent
cef1614770
commit
72f443c519
@ -322,36 +322,38 @@ GPS *createGps()
|
|||||||
#ifdef NO_GPS
|
#ifdef NO_GPS
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#else
|
#else
|
||||||
|
if (!radioConfig.preferences.gps_disabled){
|
||||||
#ifdef GPS_ALTITUDE_HAE
|
#ifdef GPS_ALTITUDE_HAE
|
||||||
DEBUG_MSG("Using HAE altitude model\n");
|
DEBUG_MSG("Using HAE altitude model\n");
|
||||||
#else
|
#else
|
||||||
DEBUG_MSG("Using MSL altitude model\n");
|
DEBUG_MSG("Using MSL altitude model\n");
|
||||||
#endif
|
#endif
|
||||||
// If we don't have bidirectional comms, we can't even try talking to UBLOX
|
// If we don't have bidirectional comms, we can't even try talking to UBLOX
|
||||||
#ifdef GPS_TX_PIN
|
#ifdef GPS_TX_PIN
|
||||||
// Init GPS - first try ublox
|
// Init GPS - first try ublox
|
||||||
UBloxGPS *ublox = new UBloxGPS();
|
UBloxGPS *ublox = new UBloxGPS();
|
||||||
|
|
||||||
if (!ublox->setup()) {
|
if (!ublox->setup()) {
|
||||||
DEBUG_MSG("ERROR: No UBLOX GPS found\n");
|
DEBUG_MSG("ERROR: No UBLOX GPS found\n");
|
||||||
delete ublox;
|
delete ublox;
|
||||||
ublox = NULL;
|
ublox = NULL;
|
||||||
} else {
|
} else {
|
||||||
return ublox;
|
return ublox;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (GPS::_serial_gps) {
|
if (GPS::_serial_gps) {
|
||||||
// Some boards might have only the TX line from the GPS connected, in that case, we can't configure it at all. Just
|
// Some boards might have only the TX line from the GPS connected, in that case, we can't configure it at all. Just
|
||||||
// assume NMEA at 9600 baud.
|
// assume NMEA at 9600 baud.
|
||||||
DEBUG_MSG("Hoping that NMEA might work\n");
|
DEBUG_MSG("Hoping that NMEA might work\n");
|
||||||
#ifdef HAS_AIR530_GPS
|
#ifdef HAS_AIR530_GPS
|
||||||
GPS *new_gps = new Air530GPS();
|
GPS *new_gps = new Air530GPS();
|
||||||
#else
|
#else
|
||||||
GPS *new_gps = new NMEAGPS();
|
GPS *new_gps = new NMEAGPS();
|
||||||
#endif
|
#endif
|
||||||
new_gps->setup();
|
new_gps->setup();
|
||||||
return new_gps;
|
return new_gps;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user