fix(core): optimize GPS loop and add display GPIO safeguards
This commit is contained in:
@@ -695,8 +695,8 @@ void EnvironmentSensorManager::loop() {
|
|||||||
static long next_gps_update = 0;
|
static long next_gps_update = 0;
|
||||||
|
|
||||||
#if ENV_INCLUDE_GPS
|
#if ENV_INCLUDE_GPS
|
||||||
|
_location->loop();
|
||||||
if (millis() > next_gps_update) {
|
if (millis() > next_gps_update) {
|
||||||
_location->loop();
|
|
||||||
|
|
||||||
if(gps_active){
|
if(gps_active){
|
||||||
#ifdef RAK_WISBLOCK_GPS
|
#ifdef RAK_WISBLOCK_GPS
|
||||||
|
|||||||
@@ -23,9 +23,13 @@ bool ST7789LCDDisplay::begin() {
|
|||||||
if (!_isOn) {
|
if (!_isOn) {
|
||||||
if (_peripher_power) _peripher_power->claim();
|
if (_peripher_power) _peripher_power->claim();
|
||||||
|
|
||||||
pinMode(PIN_TFT_LEDA_CTL, OUTPUT);
|
if (PIN_TFT_LEDA_CTL != -1) {
|
||||||
digitalWrite(PIN_TFT_LEDA_CTL, HIGH);
|
pinMode(PIN_TFT_LEDA_CTL, OUTPUT);
|
||||||
digitalWrite(PIN_TFT_RST, HIGH);
|
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.
|
// Im not sure if this is just a t-deck problem or not, if your display is slow try this.
|
||||||
#ifdef LILYGO_TDECK
|
#ifdef LILYGO_TDECK
|
||||||
@@ -54,9 +58,15 @@ void ST7789LCDDisplay::turnOn() {
|
|||||||
|
|
||||||
void ST7789LCDDisplay::turnOff() {
|
void ST7789LCDDisplay::turnOff() {
|
||||||
if (_isOn) {
|
if (_isOn) {
|
||||||
digitalWrite(PIN_TFT_LEDA_CTL, HIGH);
|
if (PIN_TFT_LEDA_CTL != -1) {
|
||||||
digitalWrite(PIN_TFT_RST, LOW);
|
digitalWrite(PIN_TFT_LEDA_CTL, HIGH);
|
||||||
digitalWrite(PIN_TFT_LEDA_CTL, LOW);
|
}
|
||||||
|
if (PIN_TFT_RST != -1) {
|
||||||
|
digitalWrite(PIN_TFT_RST, LOW);
|
||||||
|
}
|
||||||
|
if (PIN_TFT_LEDA_CTL != -1) {
|
||||||
|
digitalWrite(PIN_TFT_LEDA_CTL, LOW);
|
||||||
|
}
|
||||||
_isOn = false;
|
_isOn = false;
|
||||||
|
|
||||||
if (_peripher_power) _peripher_power->release();
|
if (_peripher_power) _peripher_power->release();
|
||||||
|
|||||||
Reference in New Issue
Block a user