In my work for #11 I accidentially created a serious bug on Heltec...

devices.  It caused bogus i2c transactions when device would go to sleep.
Fixed now, also, I now treat GPS usage uniformly between TBEAM and HELTEC
we always probe for and use the GPS if we find it.

Which means for the extra nerds
(someone requested this, I'm sorry - I don't remember who) you can now
optionally attach an external GPS to HELTECs if you want.  The pins are:

 #define GPS_RX_PIN 34
 #define GPS_TX_PIN 12

(@girtsf, sorry about including formatting changes in this PR, apparently
I had my IDE set to not autoreformat until just now
1.2-legacy
geeksville 2020-03-15 16:46:28 -07:00
rodzic 74f7b7b622
commit d0b8adab75
2 zmienionych plików z 57 dodań i 56 usunięć

Wyświetl plik

@ -137,12 +137,15 @@ bool GPS::canSleep()
/// Prepare the GPS for the cpu entering deep or light sleep, expect to be gone for at least 100s of msecs /// Prepare the GPS for the cpu entering deep or light sleep, expect to be gone for at least 100s of msecs
void GPS::prepareSleep() void GPS::prepareSleep()
{ {
if (isConnected)
ublox.powerOff(); ublox.powerOff();
} }
void GPS::doTask() void GPS::doTask()
{ {
#ifdef GPS_RX_PIN #ifdef GPS_RX_PIN
if (isConnected)
{
// Consume all characters that have arrived // Consume all characters that have arrived
// getPVT automatically calls checkUblox // getPVT automatically calls checkUblox
@ -202,7 +205,7 @@ void GPS::doTask()
} }
else // we didn't get a location update, go back to sleep and hope the characters show up else // we didn't get a location update, go back to sleep and hope the characters show up
wantNewLocation = true; wantNewLocation = true;
}
#endif #endif
// Once we have sent a location once we only poll the GPS rarely, otherwise check back every 1s until we have something over the serial // Once we have sent a location once we only poll the GPS rarely, otherwise check back every 1s until we have something over the serial

Wyświetl plik

@ -41,8 +41,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Select which board is being used. If the outside build environment has sent a choice, just use that // Select which board is being used. If the outside build environment has sent a choice, just use that
#if !defined(T_BEAM_V10) && !defined(HELTEC_LORA32) #if !defined(T_BEAM_V10) && !defined(HELTEC_LORA32)
#define T_BEAM_V10 // AKA Rev1 (second board released) // #define T_BEAM_V10 // AKA Rev1 (second board released)
// #define HELTEC_LORA32 #define HELTEC_LORA32
#define HW_VERSION_US // We encode the hardware freq range in the hw version string, so sw update can eventually install the correct build #define HW_VERSION_US // We encode the hardware freq range in the hw version string, so sw update can eventually install the correct build
#endif #endif
@ -84,14 +84,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define GPS_SERIAL_NUM 1 #define GPS_SERIAL_NUM 1
#define GPS_BAUDRATE 9600 #define GPS_BAUDRATE 9600
#if defined(T_BEAM_V10)
#define GPS_RX_PIN 34 #define GPS_RX_PIN 34
#ifdef USE_JTAG #ifdef USE_JTAG
#define GPS_TX_PIN -1 #define GPS_TX_PIN -1
#else #else
#define GPS_TX_PIN 12 #define GPS_TX_PIN 12
#endif #endif
#endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// LoRa SPI // LoRa SPI