Skip to content

Commit c9577b6

Browse files
committed
more display testing
1 parent 10cb7c6 commit c9577b6

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

src/boards_pinout.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@
186186
#define OLED_RST -1
187187
#endif
188188

189-
#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)
189+
190+
#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)
190191
#define HAS_DISPLAY
191192
#endif
192193

src/display.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,22 @@ void displaySetup() {
6767
digitalWrite(OLED_RST, HIGH);
6868
#endif
6969

70-
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
71-
Serial.println(F("SSD1306 allocation failed"));
72-
for(;;); // Don't proceed, loop forever
73-
}
74-
if (Config.display.turn180) {
70+
if(display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
71+
if (Config.display.turn180) {
7572
display.setRotation(2);
73+
}
74+
display.clearDisplay();
75+
display.setTextColor(WHITE);
76+
display.setTextSize(1);
77+
display.setCursor(0, 0);
78+
display.ssd1306_command(SSD1306_SETCONTRAST);
79+
display.ssd1306_command(1);
80+
display.display();
81+
} else {
82+
//Serial.println(F("SSD1306 allocation failed"));
83+
#undef HAS_DISPLAY
7684
}
77-
display.clearDisplay();
78-
display.setTextColor(WHITE);
79-
display.setTextSize(1);
80-
display.setCursor(0, 0);
81-
display.ssd1306_command(SSD1306_SETCONTRAST);
82-
display.ssd1306_command(1);
83-
display.display();
85+
8486
#endif
8587
#endif
8688
delay(1000);

0 commit comments

Comments
 (0)