Browse Source
Merge pull request #1179 from carroarmato0/tdeck-gps
Enable GPS for LilyGo TDeck + Optimizations
pull/1196/head
ripplebiz
7 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
42 additions and
9 deletions
-
src/helpers/sensors/EnvironmentSensorManager.cpp
-
src/helpers/ui/ST7789LCDDisplay.cpp
-
variants/lilygo_tdeck/platformio.ini
-
variants/lilygo_tdeck/target.cpp
-
variants/lilygo_tdeck/target.h
|
|
|
@ -695,8 +695,8 @@ void EnvironmentSensorManager::loop() { |
|
|
|
static long next_gps_update = 0; |
|
|
|
|
|
|
|
#if ENV_INCLUDE_GPS |
|
|
|
if (millis() > next_gps_update) { |
|
|
|
_location->loop(); |
|
|
|
if (millis() > next_gps_update) { |
|
|
|
|
|
|
|
if(gps_active){ |
|
|
|
#ifdef RAK_WISBLOCK_GPS |
|
|
|
|
|
|
|
@ -23,9 +23,13 @@ bool ST7789LCDDisplay::begin() { |
|
|
|
if (!_isOn) { |
|
|
|
if (_peripher_power) _peripher_power->claim(); |
|
|
|
|
|
|
|
if (PIN_TFT_LEDA_CTL != -1) { |
|
|
|
pinMode(PIN_TFT_LEDA_CTL, OUTPUT); |
|
|
|
digitalWrite(PIN_TFT_LEDA_CTL, HIGH); |
|
|
|
} |
|
|
|
if (PIN_TFT_RST != -1) { |
|
|
|
digitalWrite(PIN_TFT_RST, HIGH); |
|
|
|
} |
|
|
|
|
|
|
|
// Im not sure if this is just a t-deck problem or not, if your display is slow try this.
|
|
|
|
#ifdef LILYGO_TDECK |
|
|
|
@ -54,9 +58,15 @@ void ST7789LCDDisplay::turnOn() { |
|
|
|
|
|
|
|
void ST7789LCDDisplay::turnOff() { |
|
|
|
if (_isOn) { |
|
|
|
if (PIN_TFT_LEDA_CTL != -1) { |
|
|
|
digitalWrite(PIN_TFT_LEDA_CTL, HIGH); |
|
|
|
} |
|
|
|
if (PIN_TFT_RST != -1) { |
|
|
|
digitalWrite(PIN_TFT_RST, LOW); |
|
|
|
} |
|
|
|
if (PIN_TFT_LEDA_CTL != -1) { |
|
|
|
digitalWrite(PIN_TFT_LEDA_CTL, LOW); |
|
|
|
} |
|
|
|
_isOn = false; |
|
|
|
|
|
|
|
if (_peripher_power) _peripher_power->release(); |
|
|
|
|
|
|
|
@ -19,6 +19,21 @@ build_flags = |
|
|
|
-D SX126X_RX_BOOSTED_GAIN=1 |
|
|
|
-D SX126X_DIO3_TCXO_VOLTAGE=1.8f |
|
|
|
-D P_LORA_DIO_1=45 ; LORA IRQ pin |
|
|
|
-D ENV_INCLUDE_GPS=1 |
|
|
|
-D ENV_INCLUDE_AHTX0=0 |
|
|
|
-D ENV_INCLUDE_BME280=0 |
|
|
|
-D ENV_INCLUDE_BMP280=0 |
|
|
|
-D ENV_INCLUDE_SHTC3=0 |
|
|
|
-D ENV_INCLUDE_SHT4X=0 |
|
|
|
-D ENV_INCLUDE_LPS22HB=0 |
|
|
|
-D ENV_INCLUDE_INA3221=0 |
|
|
|
-D ENV_INCLUDE_INA219=0 |
|
|
|
-D ENV_INCLUDE_INA226=0 |
|
|
|
-D ENV_INCLUDE_INA260=0 |
|
|
|
-D ENV_INCLUDE_MLX90614=0 |
|
|
|
-D ENV_INCLUDE_VL53L0X=0 |
|
|
|
-D ENV_INCLUDE_BME680=0 |
|
|
|
-D ENV_INCLUDE_BMP085=0 |
|
|
|
-D P_LORA_NSS=9 ; LORA SS pin |
|
|
|
-D P_LORA_RESET=17 ; LORA RST pin |
|
|
|
-D P_LORA_BUSY=13 ; LORA Busy pin |
|
|
|
@ -35,8 +50,12 @@ build_flags = |
|
|
|
-D PIN_TFT_DC=11 |
|
|
|
-D PIN_TFT_SCL=40 |
|
|
|
-D PIN_TFT_SDA=41 |
|
|
|
-D PIN_GPS_RX=43 |
|
|
|
-D PIN_GPS_TX=44 |
|
|
|
-D GPS_BAUD_RATE=38400 |
|
|
|
build_src_filter = ${esp32_base.build_src_filter} |
|
|
|
+<../variants/lilygo_tdeck> |
|
|
|
+<helpers/sensors/*.cpp> |
|
|
|
lib_deps = |
|
|
|
${esp32_base.lib_deps} |
|
|
|
${sensor_base.lib_deps} |
|
|
|
|
|
|
|
@ -14,7 +14,8 @@ WRAPPER_CLASS radio_driver(radio, board); |
|
|
|
|
|
|
|
ESP32RTCClock fallback_clock; |
|
|
|
AutoDiscoverRTCClock rtc_clock(fallback_clock); |
|
|
|
SensorManager sensors; |
|
|
|
MicroNMEALocationProvider gps(Serial1, &rtc_clock); |
|
|
|
EnvironmentSensorManager sensors(gps); |
|
|
|
|
|
|
|
#ifdef DISPLAY_CLASS |
|
|
|
DISPLAY_CLASS display; |
|
|
|
@ -24,6 +25,7 @@ SensorManager sensors; |
|
|
|
bool radio_init() { |
|
|
|
fallback_clock.begin(); |
|
|
|
rtc_clock.begin(Wire); |
|
|
|
Wire.begin(18, 8); |
|
|
|
|
|
|
|
#if defined(P_LORA_SCLK) |
|
|
|
return radio.std_init(&spi); |
|
|
|
|
|
|
|
@ -11,11 +11,13 @@ |
|
|
|
#include <helpers/ui/ST7789LCDDisplay.h> |
|
|
|
#include <helpers/ui/MomentaryButton.h> |
|
|
|
#endif |
|
|
|
#include "helpers/sensors/EnvironmentSensorManager.h" |
|
|
|
#include "helpers/sensors/MicroNMEALocationProvider.h" |
|
|
|
|
|
|
|
extern TDeckBoard board; |
|
|
|
extern WRAPPER_CLASS radio_driver; |
|
|
|
extern AutoDiscoverRTCClock rtc_clock; |
|
|
|
extern SensorManager sensors; |
|
|
|
extern EnvironmentSensorManager sensors; |
|
|
|
|
|
|
|
#ifdef DISPLAY_CLASS |
|
|
|
extern DISPLAY_CLASS display; |
|
|
|
|