mirror of https://github.com/ArduPilot/ardupilot
AP_GPS: enable GNSS modules handled by PX4 firmware via GPS_TYPE
GNSS modules handled by PX4 drivers are not auto-detectable, some are not even connected to a UART port. The activation is therefore controlled by GPS_TYPE only. Baud rate and port settings (if applicable) have to be handled by the PX4 firmware.
This commit is contained in:
parent
442aafbd1e
commit
abad58874c
|
@ -146,7 +146,13 @@ AP_GPS::detect_instance(uint8_t instance)
|
|||
AP_HAL::UARTDriver *port = instance==0?hal.uartB:hal.uartE;
|
||||
struct detect_state *dstate = &detect_state[instance];
|
||||
|
||||
if (port == NULL) {
|
||||
if (_type[instance] == GPS_TYPE_PX4) {
|
||||
// check for explicitely chosen PX4 GPS beforehand
|
||||
// it is not possible to autodetect it, nor does it require a real UART
|
||||
hal.console->print_P(PSTR(" PX4 "));
|
||||
new_gps = new AP_GPS_PX4(*this, state[instance], port);
|
||||
}
|
||||
else if (port == NULL) {
|
||||
// UART not available
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -91,7 +91,8 @@ public:
|
|||
GPS_TYPE_NMEA = 5,
|
||||
GPS_TYPE_SIRF = 6,
|
||||
GPS_TYPE_HIL = 7,
|
||||
GPS_TYPE_SBP = 8
|
||||
GPS_TYPE_SBP = 8,
|
||||
GPS_TYPE_PX4 = 9
|
||||
};
|
||||
|
||||
/// GPS status codes
|
||||
|
@ -413,5 +414,6 @@ private:
|
|||
#include <AP_GPS_NMEA.h>
|
||||
#include <AP_GPS_SIRF.h>
|
||||
#include <AP_GPS_SBP.h>
|
||||
#include <AP_GPS_PX4.h>
|
||||
|
||||
#endif // __AP_GPS_H__
|
||||
|
|
Loading…
Reference in New Issue