From d94e3dd48fd1943f5d9ea921b5f4657ff45139a2 Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Wed, 15 May 2024 14:30:33 +1000 Subject: [PATCH] AP_GPS: add support for setting the default Ublox baudrate --- libraries/AP_GPS/AP_GPS.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libraries/AP_GPS/AP_GPS.cpp b/libraries/AP_GPS/AP_GPS.cpp index 7ed14be077cce..cd00badab2884 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -72,13 +72,21 @@ extern const AP_HAL::HAL &hal; // baudrates to try to detect GPSes with const uint32_t AP_GPS::_baudrates[] = {9600U, 115200U, 4800U, 19200U, 38400U, 57600U, 230400U, 460800U}; - +#ifndef AP_GPS_UBLOX_DEFAULT_BAUDRATE +#define AP_GPS_UBLOX_DEFAULT_BAUDRATE 230400 +#endif // initialisation blobs to send to the GPS to try to get it into the // right mode. const char AP_GPS::_initialisation_blob[] = #if AP_GPS_UBLOX_ENABLED +#if AP_GPS_UBLOX_DEFAULT_BAUDRATE == 115200 + UBLOX_SET_BINARY_115200 +#elif AP_GPS_UBLOX_DEFAULT_BAUDRATE == 460800 + UBLOX_SET_BINARY_460800 +#else UBLOX_SET_BINARY_230400 #endif +#endif #if AP_GPS_SIRF_ENABLED SIRF_SET_BINARY #endif