kopia lustrzana https://github.com/meshtastic/firmware
Heltec-Tracker: GPS support (#2615)
* Heltec-Tracker: GPS support * trunk fmt --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>pull/2618/head
rodzic
e4e26a819b
commit
ab32503601
|
@ -83,6 +83,7 @@ jobs:
|
|||
include:
|
||||
- board: heltec-v3
|
||||
- board: heltec-wsl-v3
|
||||
- board: heltec-wireless-tracker
|
||||
- board: tbeam-s3-core
|
||||
- board: tlora-t3s3-v1
|
||||
uses: ./.github/workflows/build_esp32_s3.yml
|
||||
|
|
|
@ -106,7 +106,7 @@ class GPSStatus : public Status
|
|||
bool matches(const GPSStatus *newStatus) const
|
||||
{
|
||||
#ifdef GPS_EXTRAVERBOSE
|
||||
LOG_DEBUG("GPSStatus.match() new pos@%x to old pos@%x\n", newStatus->p.pos_timestamp, p.pos_timestamp);
|
||||
LOG_DEBUG("GPSStatus.match() new pos@%x to old pos@%x\n", newStatus->p.timestamp, p.timestamp);
|
||||
#endif
|
||||
return (newStatus->hasLock != hasLock || newStatus->isConnected != isConnected ||
|
||||
newStatus->isPowerSaving != isPowerSaving || newStatus->p.latitude_i != p.latitude_i ||
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
#include "configuration.h"
|
||||
#include "sleep.h"
|
||||
|
||||
#ifndef GPS_RESET_MODE
|
||||
#define GPS_RESET_MODE HIGH
|
||||
#endif
|
||||
|
||||
// If we have a serial GPS port it will not be null
|
||||
#ifdef GPS_SERIAL_NUM
|
||||
HardwareSerial _serial_gps_real(GPS_SERIAL_NUM);
|
||||
|
@ -215,6 +219,11 @@ bool GPS::setupGPS()
|
|||
// Switch to Vehicle Mode, since SoftRF enables Aviation < 2g
|
||||
_serial_gps->write("$PCAS11,3*1E\r\n");
|
||||
delay(250);
|
||||
} else if (gnssModel == GNSS_MODEL_UC6850) {
|
||||
|
||||
// use GPS + GLONASS
|
||||
_serial_gps->write("$CFGSYS,h15\r\n");
|
||||
delay(250);
|
||||
} else if (gnssModel == GNSS_MODEL_UBLOX) {
|
||||
|
||||
// Configure GNSS system to GPS+SBAS+GLONASS (Module may restart after this command)
|
||||
|
@ -571,10 +580,10 @@ bool GPS::setup()
|
|||
#endif
|
||||
|
||||
#ifdef PIN_GPS_RESET
|
||||
digitalWrite(PIN_GPS_RESET, 1); // assert for 10ms
|
||||
digitalWrite(PIN_GPS_RESET, GPS_RESET_MODE); // assert for 10ms
|
||||
pinMode(PIN_GPS_RESET, OUTPUT);
|
||||
delay(10);
|
||||
digitalWrite(PIN_GPS_RESET, 0);
|
||||
digitalWrite(PIN_GPS_RESET, !GPS_RESET_MODE);
|
||||
#endif
|
||||
setAwake(true); // Wake GPS power before doing any init
|
||||
bool ok = setupGPS();
|
||||
|
@ -850,6 +859,9 @@ GnssModel_t GPS::probe()
|
|||
return GNSS_MODEL_UBLOX;
|
||||
#elif defined(GPS_L76K)
|
||||
return GNSS_MODEL_MTK;
|
||||
#elif defined(GPS_UC6580)
|
||||
_serial_gps->updateBaudRate(115200);
|
||||
return GNSS_MODEL_UC6850;
|
||||
#else
|
||||
// we use autodetect, only T-BEAM S3 for now...
|
||||
uint8_t buffer[256];
|
||||
|
|
|
@ -14,6 +14,7 @@ struct uBloxGnssModelInfo {
|
|||
typedef enum {
|
||||
GNSS_MODEL_MTK,
|
||||
GNSS_MODEL_UBLOX,
|
||||
GNSS_MODEL_UC6850,
|
||||
GNSS_MODEL_UNKNOWN,
|
||||
} GnssModel_t;
|
||||
|
||||
|
@ -149,7 +150,7 @@ class GPS : private concurrency::OSThread
|
|||
*/
|
||||
void setAwake(bool on);
|
||||
|
||||
/** Get how long we should stay looking for each acquisition
|
||||
/** Get how long we should stay looking for each aquisition
|
||||
*/
|
||||
uint32_t getWakeTime() const;
|
||||
|
||||
|
@ -167,6 +168,7 @@ class GPS : private concurrency::OSThread
|
|||
virtual int32_t runOnce() override;
|
||||
|
||||
// Get GNSS model
|
||||
String getNMEA();
|
||||
GnssModel_t probe();
|
||||
|
||||
int getAck(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t requestedID);
|
||||
|
|
|
@ -37,9 +37,10 @@
|
|||
#define PIN_GPS_RESET 35
|
||||
#define PIN_GPS_PPS 36
|
||||
#define VGNSS_CTRL 37 // Heltec Tracker needs this pulled low for GPS
|
||||
#define GPS_RESET_MODE LOW
|
||||
#define GPS_UC6580
|
||||
|
||||
#define USE_SX1262
|
||||
|
||||
#define LORA_DIO0 -1 // a No connect on the SX1262 module
|
||||
#define LORA_RESET 12
|
||||
#define LORA_DIO1 14 // SX1262 IRQ
|
||||
|
|
Ładowanie…
Reference in New Issue