mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-30 14:55:46 +00:00
Fix low power consumption issues
This commit is contained in:
@@ -18,17 +18,23 @@ bool SSD1306Display::begin() {
|
||||
}
|
||||
|
||||
void SSD1306Display::turnOn() {
|
||||
display.ssd1306_command(SSD1306_DISPLAYON);
|
||||
if (!_isOn) {
|
||||
if (_peripher_power) _peripher_power->claim();
|
||||
if (_peripher_power) {
|
||||
_peripher_power->claim();
|
||||
begin();
|
||||
}
|
||||
_isOn = true;
|
||||
}
|
||||
display.ssd1306_command(SSD1306_DISPLAYON);
|
||||
}
|
||||
|
||||
void SSD1306Display::turnOff() {
|
||||
display.ssd1306_command(SSD1306_DISPLAYOFF);
|
||||
if (_isOn) {
|
||||
if (_peripher_power) _peripher_power->release();
|
||||
if (_peripher_power) {
|
||||
if (PIN_OLED_RESET >= 0) digitalWrite(PIN_OLED_RESET, LOW);
|
||||
_peripher_power->release();
|
||||
}
|
||||
_isOn = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ build_flags =
|
||||
-D HELTEC_LORA_V4_OLED
|
||||
-D PIN_BOARD_SDA=17
|
||||
-D PIN_BOARD_SCL=18
|
||||
-D PIN_OLED_RESET=21
|
||||
-D ENV_PIN_SDA=4
|
||||
-D ENV_PIN_SCL=3
|
||||
build_src_filter= ${Heltec_lora32_v4.build_src_filter}
|
||||
|
||||
Reference in New Issue
Block a user