diff --git a/libraries/AP_GPS/AP_GPS.cpp b/libraries/AP_GPS/AP_GPS.cpp index efd7ce9f18..ea41e018aa 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -2054,6 +2054,13 @@ bool AP_GPS::is_healthy(uint8_t instance) const return false; } +#ifdef HAL_BUILD_AP_PERIPH + /* + on AP_Periph handling of timing is done by the flight controller + receiving the DroneCAN messages + */ + return drivers[instance] != nullptr && drivers[instance]->is_healthy(); +#else /* allow two lost frames before declaring the GPS unhealthy, but require the average frame rate to be close to 5Hz. We allow for @@ -2075,6 +2082,7 @@ bool AP_GPS::is_healthy(uint8_t instance) const return delay_ok && drivers[instance] != nullptr && drivers[instance]->is_healthy(); +#endif // HAL_BUILD_AP_PERIPH } bool AP_GPS::prepare_for_arming(void) { diff --git a/libraries/AP_GPS/AP_GPS_UBLOX.cpp b/libraries/AP_GPS/AP_GPS_UBLOX.cpp index 831fbaba90..45de386f2e 100644 --- a/libraries/AP_GPS/AP_GPS_UBLOX.cpp +++ b/libraries/AP_GPS/AP_GPS_UBLOX.cpp @@ -224,6 +224,22 @@ const AP_GPS_UBLOX::config_list AP_GPS_UBLOX::config_MB_Rover_uart2[] { }; #endif // GPS_MOVING_BASELINE +/* + config changes for M10 + we need to use B1C not B1 signal for Beidou on M10 to allow solid 5Hz, + and also disable Glonass and enable QZSS + */ +const AP_GPS_UBLOX::config_list AP_GPS_UBLOX::config_M10[] { + { ConfigKey::CFG_SIGNAL_BDS_ENA, 1}, + { ConfigKey::CFG_SIGNAL_BDS_B1_ENA, 0}, + { ConfigKey::CFG_SIGNAL_BDS_B1C_ENA, 1}, + { ConfigKey::CFG_SIGNAL_GLO_ENA, 0}, + { ConfigKey::CFG_SIGNAL_QZSS_ENA, 1}, + { ConfigKey::CFG_SIGNAL_QZSS_L1CA_ENA, 1}, + { ConfigKey::CFG_SIGNAL_QZSS_L1S_ENA, 1}, + { ConfigKey::CFG_NAVSPG_DYNMODEL, 8}, // Air < 4g +}; + void AP_GPS_UBLOX::_request_next_config(void) @@ -406,6 +422,19 @@ AP_GPS_UBLOX::_request_next_config(void) _unconfigured_messages &= ~CONFIG_TIM_TM2; #endif break; + + + case STEP_M10: { + // special handling of M10 config + const config_list *list = config_M10; + const uint8_t list_length = ARRAY_SIZE(config_M10); + Debug("Sending M10 settings"); + if (!_configure_config_set(list, list_length, CONFIG_M10, UBX_VALSET_LAYER_RAM | UBX_VALSET_LAYER_BBR)) { + _next_message--; + } + break; + } + default: // this case should never be reached, do a full reset if it is hit _next_message = STEP_PVT; @@ -1175,26 +1204,27 @@ AP_GPS_UBLOX::_parse_gps(void) default: break; } -#if GPS_MOVING_BASELINE // see if it is in active config list int8_t cfg_idx = find_active_config_index(id); if (cfg_idx >= 0) { const uint8_t key_size = config_key_size(id); if (cfg_len < key_size || memcmp(&active_config.list[cfg_idx].value, cfg_data, key_size) != 0) { - _configure_valset(id, &active_config.list[cfg_idx].value); + _configure_valset(id, &active_config.list[cfg_idx].value, active_config.layers); _unconfigured_messages |= active_config.unconfig_bit; active_config.done_mask &= ~(1U << cfg_idx); _cfg_needs_save = true; } else { active_config.done_mask |= (1U << cfg_idx); + Debug("done %u mask=0x%x", + unsigned(cfg_idx), + unsigned(active_config.done_mask)); if (active_config.done_mask == (1U<