mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 09:26:52 +00:00
Don't skip GPS serial speeds, and always land on GPS_BAUDRATE (#5195)
* Don't skip GPS serial speeds, and always land on GPS_BAUDRATE * Update log message to match. * print the value instead
This commit is contained in:
parent
7912c214c7
commit
545ebf9b17
@ -421,7 +421,7 @@ bool GPS::setup()
|
|||||||
if (tx_gpio && gnssModel == GNSS_MODEL_UNKNOWN) {
|
if (tx_gpio && gnssModel == GNSS_MODEL_UNKNOWN) {
|
||||||
|
|
||||||
// if GPS_BAUDRATE is specified in variant (i.e. not 9600), skip to the specified rate.
|
// if GPS_BAUDRATE is specified in variant (i.e. not 9600), skip to the specified rate.
|
||||||
if (speedSelect == 0 && GPS_BAUDRATE != serialSpeeds[speedSelect]) {
|
if (speedSelect == 0 && probeTries == 2 && GPS_BAUDRATE != serialSpeeds[speedSelect]) {
|
||||||
speedSelect = std::find(serialSpeeds, std::end(serialSpeeds), GPS_BAUDRATE) - serialSpeeds;
|
speedSelect = std::find(serialSpeeds, std::end(serialSpeeds), GPS_BAUDRATE) - serialSpeeds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,7 +431,7 @@ bool GPS::setup()
|
|||||||
if (++speedSelect == sizeof(serialSpeeds) / sizeof(int)) {
|
if (++speedSelect == sizeof(serialSpeeds) / sizeof(int)) {
|
||||||
speedSelect = 0;
|
speedSelect = 0;
|
||||||
if (--probeTries == 0) {
|
if (--probeTries == 0) {
|
||||||
LOG_WARN("Giving up on GPS probe and setting to 9600.");
|
LOG_WARN("Giving up on GPS probe and setting to %d", GPS_BAUDRATE);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ class GPS : private concurrency::OSThread
|
|||||||
uint8_t fixType = 0; // fix type from GPGSA
|
uint8_t fixType = 0; // fix type from GPGSA
|
||||||
#endif
|
#endif
|
||||||
private:
|
private:
|
||||||
const int serialSpeeds[6] = {9600, 115200, 38400, 4800, 57600, 9600};
|
const int serialSpeeds[6] = {9600, 115200, 38400, 4800, 57600, GPS_BAUDRATE};
|
||||||
uint32_t lastWakeStartMsec = 0, lastSleepStartMsec = 0, lastFixStartMsec = 0;
|
uint32_t lastWakeStartMsec = 0, lastSleepStartMsec = 0, lastFixStartMsec = 0;
|
||||||
uint32_t rx_gpio = 0;
|
uint32_t rx_gpio = 0;
|
||||||
uint32_t tx_gpio = 0;
|
uint32_t tx_gpio = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user