1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Beginning of the great GPS unfucking.

* Proper initialization sequence framework for various supported GPS types. NMEA will now auto-detect its baud rate based on received frames.
* As a result of the above, gps_baudrate has been changed to enum, to only allow fixed rates. (GPS baudrate, -1: autodetect (NMEA only), 0: 115200, 1: 57600, 2: 38400, 3: 19200, 4: 9600)
* UBX binary initialization at any specified baudrate with auto-reconnect on signal loss.
* GPS thread to handle initialization, signal loss and configuration. No longer does GPS need to be powered before FC, and on GPS reconnect, it will be re-initialized if needed.
MTK NMEA/binary initialization is omitted for now, as I can't find my MTK GPS
GPS deltaTime can be calculated to display update rate.


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@438 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
timecop@gmail.com 2013-10-13 15:25:45 +00:00
parent 04560808e7
commit 30ded7ff04
8 changed files with 209 additions and 126 deletions

View file

@ -13,7 +13,7 @@ master_t mcfg; // master config struct with data independent from profiles
config_t cfg; // profile config struct
const char rcChannelLetters[] = "AERT1234";
static const uint8_t EEPROM_CONF_VERSION = 52;
static const uint8_t EEPROM_CONF_VERSION = 53;
static uint32_t enabledSensors = 0;
static void resetConf(void);
@ -84,7 +84,7 @@ void readEEPROM(void)
}
setPIDController(cfg.pidController);
GPS_set_pids();
gpsSetPIDs();
}
void writeEEPROM(uint8_t b, uint8_t updateProfile)
@ -205,7 +205,7 @@ static void resetConf(void)
mcfg.servo_pwm_rate = 50;
// gps/nav stuff
mcfg.gps_type = GPS_NMEA;
mcfg.gps_baudrate = 115200;
mcfg.gps_baudrate = 0;
// serial (USART1) baudrate
mcfg.serial_baudrate = 115200;
mcfg.softserial_baudrate = 19200;