more display testing

This commit is contained in:
richonguzman 2024-10-25 11:08:00 -03:00
parent 10cb7c6e45
commit c9577b6c21
2 changed files with 16 additions and 13 deletions

View file

@ -186,7 +186,8 @@
#define OLED_RST -1
#endif
#if !defined(LIGHTGATEWAY_1_0) && !defined(HELTEC_HTCT62) && !defined(HELTEC_WSL_V3) && !defined(ESP32C3_DIY_1W_LoRa) && !defined(ESP32C3_DIY_1W_LoRa_915) && !defined(WEMOS_S2_MINI_DIY_LoRa)
#if !defined(HELTEC_HTCT62) && !defined(HELTEC_WSL_V3) && !defined(ESP32C3_DIY_1W_LoRa) && !defined(ESP32C3_DIY_1W_LoRa_915) && !defined(WEMOS_S2_MINI_DIY_LoRa)
#define HAS_DISPLAY
#endif

View file

@ -67,20 +67,22 @@ void displaySetup() {
digitalWrite(OLED_RST, HIGH);
#endif
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
if (Config.display.turn180) {
if(display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
if (Config.display.turn180) {
display.setRotation(2);
}
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(0, 0);
display.ssd1306_command(SSD1306_SETCONTRAST);
display.ssd1306_command(1);
display.display();
} else {
//Serial.println(F("SSD1306 allocation failed"));
#undef HAS_DISPLAY
}
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(0, 0);
display.ssd1306_command(SSD1306_SETCONTRAST);
display.ssd1306_command(1);
display.display();
#endif
#endif
delay(1000);