Skip to content

Commit

Permalink
Navigation rate change would not work, now fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pjalocha committed May 6, 2021
1 parent 381a302 commit 0a985e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main/gps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,18 @@ static void GPS_BurstStart(int CharDelay=0) // when GPS starts sending the data
}
#endif
#ifdef WITH_GPS_MTK
Format_String(GPS_UART_Write, "\r\n\r\n"); // apparently this is needed, otherwise the next command is missed
if(Parameters.NavRate)
{ uint8_t Len = Format_String(GPS_Cmd, "$PMTK220,"); // navigation rate
{ // uint8_t Len = Format_String(GPS_Cmd, "$PMTK220,"); // report rate
uint8_t Len = Format_String(GPS_Cmd, "$PMTK300,"); // fix rate
uint16_t OneSec = 1000;
Len += Format_UnsDec(GPS_Cmd+Len, OneSec/Parameters.NavRate);
Len += Format_String(GPS_Cmd+Len, ",0,0,0,0");
Len += NMEA_AppendCheck(GPS_Cmd, Len);
GPS_Cmd[Len++]='\r';
GPS_Cmd[Len++]='\n';
GPS_Cmd[Len]=0;
// Format_String(CONS_UART_Write, GPS_Cmd, Len, 0); // for debug
Format_String(GPS_UART_Write, GPS_Cmd, Len, 0);
GPS_Status.ModeConfig=1; }
if(Parameters.NavMode)
Expand All @@ -325,6 +329,7 @@ static void GPS_BurstStart(int CharDelay=0) // when GPS starts sending the data
GPS_Cmd[Len++]='\r';
GPS_Cmd[Len++]='\n';
GPS_Cmd[Len]=0;
// Format_String(CONS_UART_Write, GPS_Cmd, Len, 0); // for debug
Format_String(GPS_UART_Write, GPS_Cmd, Len, 0);
GPS_Status.ModeConfig=1; }
if(Parameters.GNSS)
Expand All @@ -342,6 +347,7 @@ static void GPS_BurstStart(int CharDelay=0) // when GPS starts sending the data
GPS_Cmd[Len++]='\r';
GPS_Cmd[Len++]='\n';
GPS_Cmd[Len]=0;
// Format_String(CONS_UART_Write, GPS_Cmd, Len, 0); // for debug
Format_String(GPS_UART_Write, GPS_Cmd, Len, 0); }
#endif
}
Expand Down

0 comments on commit 0a985e4

Please sign in to comment.