Fix for Pi Pico hang (#2817)

* Fix for Pi Pico hang

* Pi Pico fix part 2: Electric Boogaloo
This commit is contained in:
Jonathan Bennett 2023-09-20 19:34:45 -05:00 committed by GitHub
parent 17207681ef
commit 7eff5e7bcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,7 +252,7 @@ bool GPS::setup()
{
int msglen = 0;
if (_serial_gps && !didSerialInit) {
if (!didSerialInit) {
#if !defined(GPS_UC6580)
if (tx_gpio) {
LOG_DEBUG("Probing for GPS at %d \n", serialSpeeds[speedSelect]);
@ -548,6 +548,8 @@ void GPS::publishUpdate()
int32_t GPS::runOnce()
{
if (!GPSInitFinished) {
if (!_serial_gps)
return disable();
if (!setup())
return 2000; // Setup failed, re-run in two seconds
@ -850,7 +852,7 @@ GPS *GPS::createGps()
if (!_tx_gpio)
_tx_gpio = GPS_TX_PIN;
#endif
if (!_rx_gpio) // Configured to have no GPS at all
if (!_rx_gpio || !_serial_gps) // Configured to have no GPS at all
return nullptr;
GPS *new_gps = new GPS;