Optimise GPS Baud Rate cycle (#5102)

* Optimise GPS Baud Rate cycle

Previously, our baud rate cycled through one list twice.

There were some rarer baudrates in there, so this code
separates out those into a dedicated list that is only
run through if detection fails for common bauds. We also
only run through each baud rate once.

* Fix first time around bug

Would have always reset GPS baudrate every time.

* Add support for fixing GPS_BAUDRATE

If GPS_BAUDRATE is set in variant.h, the deployer knows something we
don't about the GPS. Used especially when the GPS is soldered to a board
in a commercial product :) If we see that, we don't try other baud rates
at all.

* Don't print blank lines in GPS_DEBUG.

* Try GPS_BAUDRATE first, not only.

* Fix spelling mistakes in comments

* Only use GPS_BAUDRATE if specified in variant.h

* Modify RareSerial Speeds based on FIXED or not.
This commit is contained in:
Tom Fifield
2024-11-02 20:51:12 +08:00
committed by GitHub
parent 8801bc5ce9
commit b0c924f185
3 changed files with 54 additions and 26 deletions

View File

@@ -207,6 +207,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef GPS_BAUDRATE
#define GPS_BAUDRATE 9600
#define GPS_BAUDRATE_FIXED 0
#else
#define GPS_BAUDRATE_FIXED 1
#endif
/* Step #2: follow with defines common to the architecture;