Skip to content

Commit

Permalink
Fix first time around bug
Browse files Browse the repository at this point in the history
Would have always reset GPS baudrate every time.
  • Loading branch information
fifieldt committed Oct 21, 2024
1 parent 9656aa4 commit 6951852
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gps/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ bool GPS::setup()
if (tx_gpio && gnssModel == GNSS_MODEL_UNKNOWN) {

// if GPS_BAUDRATE is specified in variant (i.e. not 9600), skip to the specified rate.
if (probeTries == 0 && GPS_BAUDRATE != 9600) {
if (probeTries == 0 && speedSelect == 0 && GPS_BAUDRATE != serialSpeeds[speedSelect]) {
speedSelect = std::find(serialSpeeds, std::end(serialSpeeds), GPS_BAUDRATE) - serialSpeeds;
if (speedSelect == 0) {
speedSelect = std::find(rareSerialSpeeds, std::end(rareSerialSpeeds), GPS_BAUDRATE) - rareSerialSpeeds;
Expand Down

0 comments on commit 6951852

Please sign in to comment.