change GPS to use virtual GPIOs (for #4154)

This commit is contained in:
Kevin Hester
2024-08-22 10:15:23 -07:00
parent 2dda640d27
commit 5570b6bbc6
4 changed files with 33 additions and 13 deletions

View File

@@ -3,6 +3,7 @@
#if !MESHTASTIC_EXCLUDE_GPS
#include "GPSStatus.h"
#include "GpioLogic.h"
#include "Observer.h"
#include "TinyGPS++.h"
#include "concurrency/OSThread.h"
@@ -73,7 +74,6 @@ class GPS : private concurrency::OSThread
uint32_t lastWakeStartMsec = 0, lastSleepStartMsec = 0, lastFixStartMsec = 0;
uint32_t rx_gpio = 0;
uint32_t tx_gpio = 0;
uint32_t en_gpio = 0;
int speedSelect = 0;
int probeTries = 2;
@@ -152,6 +152,13 @@ class GPS : private concurrency::OSThread
meshtastic_Position p = meshtastic_Position_init_default;
/** This is normally bound to config.position.gps_en_gpio but some rare boards (like heltec tracker) need more advanced
* implementations. Those boards will set this public variable to a custom implementation.
*
* Normally set by GPS::createGPS()
*/
GpioPin *enablePin;
GPS() : concurrency::OSThread("GPS") {}
virtual ~GPS();
@@ -303,4 +310,4 @@ class GPS : private concurrency::OSThread
};
extern GPS *gps;
#endif // Exclude GPS
#endif // Exclude GPS