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 06:30:35 -05:00
committed by GitHub
co-authored by GitHub
parent f97ae52263
commit 6e8300287b
9 changed files with 84 additions and 6 deletions
+5
View File
@@ -228,6 +228,9 @@ void cpuDeepSleep(uint32_t msecToWake)
// FIXME change polarity in hw so we can wake on ANY_HIGH instead - that would allow us to use all three buttons (instead
// of just the first) gpio_pullup_en((gpio_num_t)BUTTON_PIN);
#ifdef ESP32S3_WAKE_TYPE
esp_sleep_enable_ext1_wakeup(gpioMask, ESP32S3_WAKE_TYPE);
#else
#if SOC_PM_SUPPORT_EXT_WAKEUP
#ifdef CONFIG_IDF_TARGET_ESP32
// ESP_EXT1_WAKEUP_ALL_LOW has been deprecated since esp-idf v5.4 for any other target.
@@ -236,6 +239,8 @@ void cpuDeepSleep(uint32_t msecToWake)
esp_sleep_enable_ext1_wakeup(gpioMask, ESP_EXT1_WAKEUP_ANY_LOW);
#endif
#endif
#endif //#end ESP32S3_WAKE_TYPE
#endif
// We want RTC peripherals to stay on
+9 -2
View File
@@ -198,8 +198,15 @@ void NRF52Bluetooth::shutdown()
{
// Shutdown bluetooth for minimum power draw
LOG_INFO("Disable NRF52 bluetooth\n");
if (connectionHandle != 0) {
Bluefruit.disconnect(connectionHandle);
uint8_t connection_num=Bluefruit.connected();
if(connection_num)
{
for(uint8_t i=0;i<connection_num;i++)
{
LOG_INFO("NRF52 bluetooth disconnecting handle %d\n",i);
Bluefruit.disconnect(i);
}
delay(100);//wait for ondisconnect;
}
Bluefruit.Advertising.stop();
}
+6
View File
@@ -251,6 +251,12 @@ void cpuDeepSleep(uint32_t msecToWake)
nrf_gpio_cfg_default(WB_I2C1_SCL);
nrf_gpio_cfg_default(WB_I2C1_SDA);
#endif
#endif
#ifdef HELTEC_MESH_NODE_T114
nrf_gpio_cfg_default(PIN_GPS_PPS);
detachInterrupt(PIN_GPS_PPS);
detachInterrupt(PIN_BUTTON1);
#endif
// Sleepy trackers or sensors can low power "sleep"
// Don't enter this if we're sleeping portMAX_DELAY, since that's a shutdown event