Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default GPS baud rate to 115200 #3995

Merged
merged 1 commit into from
Nov 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/main/io/gps_ublox.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static const uint32_t ubloxScanMode1[] = {
0x00000000, 0x00000851, 0x0004E004, 0x00020200, 0x00000180, 0x00000000,
};

static const char * baudInitData[GPS_BAUDRATE_COUNT] = {
static const char * baudInitDataNMEA[GPS_BAUDRATE_COUNT] = {
"$PUBX,41,1,0003,0001,115200,0*1E\r\n", // GPS_BAUDRATE_115200
"$PUBX,41,1,0003,0001,57600,0*2D\r\n", // GPS_BAUDRATE_57600
"$PUBX,41,1,0003,0001,38400,0*26\r\n", // GPS_BAUDRATE_38400
Expand Down Expand Up @@ -696,6 +696,9 @@ STATIC_PROTOTHREAD(gpsConfigure)
{
ptBegin(gpsConfigure);

// Reset timeout
gpsSetProtocolTimeout(GPS_SHORT_TIMEOUT);

// Set dynamic model
switch (gpsState.gpsConfig->dynModel) {
case GPS_DYNMODEL_PEDESTRIAN:
Expand Down Expand Up @@ -845,7 +848,7 @@ STATIC_PROTOTHREAD(gpsProtocolStateThread)
gpsState.autoBaudrateIndex = (gpsState.autoBaudrateIndex + 1) % GPS_BAUDRATE_COUNT;

// 2. Send an $UBX command to switch the baud rate specified by portConfig [baudrateIndex]
serialPrint(gpsState.gpsPort, baudInitData[gpsState.baudrateIndex]);
serialPrint(gpsState.gpsPort, baudInitDataNMEA[gpsState.baudrateIndex]);

// 3. Wait for command to be received and processed by GPS
ptWait(isSerialTransmitBufferEmpty(gpsState.gpsPort));
Expand Down
2 changes: 1 addition & 1 deletion src/main/io/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void pgResetFn_serialConfig(serialConfig_t *serialConfig)
for (int i = 0; i < SERIAL_PORT_COUNT; i++) {
serialConfig->portConfigs[i].identifier = serialPortIdentifiers[i];
serialConfig->portConfigs[i].msp_baudrateIndex = BAUD_115200;
serialConfig->portConfigs[i].gps_baudrateIndex = BAUD_38400;
serialConfig->portConfigs[i].gps_baudrateIndex = BAUD_115200;
serialConfig->portConfigs[i].telemetry_baudrateIndex = BAUD_AUTO;
serialConfig->portConfigs[i].peripheral_baudrateIndex = BAUD_115200;
}
Expand Down