sforkowany z mirror/meshtastic-firmware
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 now1.2-legacy
rodzic
74f7b7b622
commit
d0b8adab75
|
@ -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
|
||||
void GPS::prepareSleep()
|
||||
{
|
||||
if (isConnected)
|
||||
ublox.powerOff();
|
||||
}
|
||||
|
||||
void GPS::doTask()
|
||||
{
|
||||
#ifdef GPS_RX_PIN
|
||||
if (isConnected)
|
||||
{
|
||||
// Consume all characters that have arrived
|
||||
|
||||
// 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
|
||||
wantNewLocation = true;
|
||||
|
||||
}
|
||||
#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
|
||||
|
|
|
@ -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
|
||||
#if !defined(T_BEAM_V10) && !defined(HELTEC_LORA32)
|
||||
#define T_BEAM_V10 // AKA Rev1 (second board released)
|
||||
// #define HELTEC_LORA32
|
||||
// #define T_BEAM_V10 // AKA Rev1 (second board released)
|
||||
#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
|
||||
#endif
|
||||
|
@ -84,14 +84,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#define GPS_SERIAL_NUM 1
|
||||
#define GPS_BAUDRATE 9600
|
||||
|
||||
#if defined(T_BEAM_V10)
|
||||
#define GPS_RX_PIN 34
|
||||
#ifdef USE_JTAG
|
||||
#define GPS_TX_PIN -1
|
||||
#else
|
||||
#define GPS_TX_PIN 12
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// LoRa SPI
|
||||
|
|
Ładowanie…
Reference in New Issue