WIRE update

This commit is contained in:
richonguzman 2024-10-25 11:50:57 -03:00
parent c9577b6c21
commit a91f0f3f3c
2 changed files with 36 additions and 33 deletions

View File

@ -36,6 +36,8 @@
extern Configuration Config;
String oldHeader, oldFirstLine, oldSecondLine, oldThirdLine, oldFourthLine, oldFifthLine, oldSixthLine;
bool displayFound = false;
void cleanTFT() {
#ifdef HAS_TFT
@ -68,6 +70,7 @@ void displaySetup() {
#endif
if(display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
displayFound = true;
if (Config.display.turn180) {
display.setRotation(2);
}
@ -78,11 +81,7 @@ void displaySetup() {
display.ssd1306_command(SSD1306_SETCONTRAST);
display.ssd1306_command(1);
display.display();
} else {
//Serial.println(F("SSD1306 allocation failed"));
#undef HAS_DISPLAY
}
#endif
#endif
delay(1000);
@ -98,7 +97,7 @@ void displayToggle(bool toggle) {
#if HAS_EPAPER
// ... to be continued
#else
display.ssd1306_command(SSD1306_DISPLAYON);
if (displayFound) display.ssd1306_command(SSD1306_DISPLAYON);
#endif
#endif
} else {
@ -108,7 +107,7 @@ void displayToggle(bool toggle) {
#if HAS_EPAPER
// ... to be continued
#else
display.ssd1306_command(SSD1306_DISPLAYOFF);
if (displayFound) display.ssd1306_command(SSD1306_DISPLAYOFF);
#endif
#endif
}
@ -162,6 +161,7 @@ void displayShow(const String& header, const String& line1, const String& line2,
#ifdef HAS_EPAPER
// ... to be continued
#else
if (displayFound) {
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
@ -174,6 +174,7 @@ void displayShow(const String& header, const String& line1, const String& line2,
display.ssd1306_command(SSD1306_SETCONTRAST);
display.ssd1306_command(1);
display.display();
}
#endif
#endif
delay(wait);
@ -200,6 +201,7 @@ void displayShow(const String& header, const String& line1, const String& line2,
#ifdef HAS_EPAPER
// ... to be continued
#else
if (displayFound) {
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(2);
@ -213,6 +215,7 @@ void displayShow(const String& header, const String& line1, const String& line2,
display.ssd1306_command(SSD1306_SETCONTRAST);
display.ssd1306_command(1);
display.display();
}
#endif
#endif
delay(wait);

View File

@ -205,7 +205,7 @@ namespace POWER_Utils {
Wire1.begin(BOARD_I2C_SDA, BOARD_I2C_SCL);
#endif
#if defined(HELTEC_V3) || defined(HELTEC_WS)
#if defined(HELTEC_V3) || defined(HELTEC_WS) || defined(LIGHTGATEWAY_1_0)
Wire.begin(OLED_SDA, OLED_SCL);
#endif