void gps_startup_sequence(int16_t gpscount) { if (gpscount == 100) week_no.BB = 0; else if (gpscount == 90) // Start at 38400 baud udb_gps_set_rate(38400); else if (gpscount == 80) // Set to 4Hz refresh rate gpsoutline(gps_refresh_rate); else if (gpscount == 70) // Enable SBAS gpsoutline(gps_sbas_enable); else if (gpscount == 60) // Enable WAAS gpsoutline(gps_waas_enable); else if (gpscount == 50) // Disable navigation threshold, so we get sent all position updates gpsoutline(gps_navthreshold_disable); else if (gpscount == 40) // Set up GPS for 19200 baud gpsoutline(gps_baud_rate); else if (gpscount == 30) // Switch UDB to 19200 baud udb_gps_set_rate(19200); else if (gpscount == 20) // Switch the GPS to use the custom DIY Drones binary protocol gpsoutline(gps_bin_mode); }
void gps_startup_sequence(int16_t gpscount) { if (gpscount == 980) { #if (HILSIM == 1) udb_gps_set_rate(HILSIM_BAUD); #else udb_gps_set_rate(9600); #endif } else if (dcm_flags._.nmea_passthrough && gpscount == 200) gpsoutline(disable_GSV); else if (dcm_flags._.nmea_passthrough && gpscount == 190) gpsoutline(disable_GSA); else if (dcm_flags._.nmea_passthrough && gpscount == 180) gpsoutline(disable_GLL); else if (dcm_flags._.nmea_passthrough && gpscount == 170) gpsoutline(disable_VTG); else if (dcm_flags._.nmea_passthrough && gpscount == 160) // set the UBX to use binary and nmea gpsoutline(bin_mode_withnmea); else if (!dcm_flags._.nmea_passthrough && gpscount == 160) // set the UBX to use binary mode gpsoutline(bin_mode_nonmea); #if (HILSIM != 1) else if (gpscount == 150) udb_gps_set_rate(19200); #endif else if (gpscount == 140) gpsoutbin(set_rate_length, set_rate); else if (gpscount == 130) // command GPS to select which messages are sent, using UBX interface gpsoutbin(enable_NAV_SOL_length, enable_NAV_SOL); else if (gpscount == 120) gpsoutbin(enable_NAV_POSLLH_length, enable_NAV_POSLLH); else if (gpscount == 110) gpsoutbin(enable_NAV_VELNED_length, enable_NAV_VELNED); else if (gpscount == 100) gpsoutbin(enable_NAV_DOP_length, enable_NAV_DOP); else if (dcm_flags._.nmea_passthrough && gpscount == 90) gpsoutbin(enable_UBX_only_length, enable_UBX_NMEA); else if (!dcm_flags._.nmea_passthrough && gpscount == 90) gpsoutbin(enable_UBX_only_length, enable_UBX_only); else if (gpscount == 80) gpsoutbin(enable_SBAS_length, enable_SBAS); else if (gpscount == 70) gpsoutbin(config_NAV5_length, config_NAV5); }