Heltec boards sensor and low power features update (#4418)

* Update sensor drive and low power features.

* Update ST7789 TFT control logic.

* Update Heltec nRF board low power features.

* Update the GPS UART port pointer
This commit is contained in:
Aaron.Lee
2024-08-13 19:30:35 +08:00
committed by GitHub
parent f97ae52263
commit 6e8300287b
9 changed files with 84 additions and 6 deletions

View File

@@ -319,6 +319,14 @@ void setup()
digitalWrite(RESET_OLED, 1);
#endif
#ifdef SENSOR_POWER_CTRL_PIN
pinMode(SENSOR_POWER_CTRL_PIN,OUTPUT);
digitalWrite(SENSOR_POWER_CTRL_PIN,SENSOR_POWER_ON);
#endif
#ifdef SENSOR_GPS_CONFLICT
bool sensor_detected=false;
#endif
#ifdef PERIPHERAL_WARMUP_MS
// Some peripherals may require additional time to stabilize after power is connected
// e.g. I2C on Heltec Vision Master
@@ -458,6 +466,9 @@ void setup()
LOG_INFO("No I2C devices found\n");
} else {
LOG_INFO("%i I2C devices found\n", i2cCount);
#ifdef SENSOR_GPS_CONFLICT
sensor_detected=true;
#endif
}
#ifdef ARCH_ESP32
@@ -703,6 +714,10 @@ void setup()
#if !MESHTASTIC_EXCLUDE_GPS
// If we're taking on the repeater role, ignore GPS
#ifdef SENSOR_GPS_CONFLICT
if(sensor_detected==false)
{
#endif
if (HAS_GPS) {
if (config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER &&
config.position.gps_mode != meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT) {
@@ -714,6 +729,10 @@ void setup()
}
}
}
#ifdef SENSOR_GPS_CONFLICT
}
#endif
#endif
nodeStatus->observe(&nodeDB->newStatus);