From 2a50ae05dd36b02cc2722c1d53286a9294c3e076 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 20 Aug 2025 06:00:24 -0500 Subject: [PATCH 1/2] Account for 128x128 SH1107 displays --- src/main.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c53877e37..42f9c12f7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -770,15 +770,19 @@ void setup() if (config.display.oled != meshtastic_Config_DisplayConfig_OledType_OLED_AUTO) screen_model = config.display.oled; -#if defined(USE_SH1107) - screen_model = meshtastic_Config_DisplayConfig_OledType_OLED_SH1107; // set dimension of 128x128 - screen_geometry = GEOMETRY_128_128; -#endif - #if defined(USE_SH1107_128_64) screen_model = meshtastic_Config_DisplayConfig_OledType_OLED_SH1107; // keep dimension of 128x64 + screen_geometry = GEOMETRY_128_64; #endif + // if we have one of the fixed overrides in the settings, adjust display type accordingly. + if (screen_model == meshtastic_Config_DisplayConfig_OledType_OLED_SH1107) { + screen_geometry = GEOMETRY_128_64; + + } else if (screen_model == meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_128) { + screen_geometry = GEOMETRY_128_128; + } + #if !MESHTASTIC_EXCLUDE_I2C #if !defined(ARCH_STM32WL) if (acc_info.type != ScanI2C::DeviceType::NONE) { @@ -824,7 +828,7 @@ void setup() #elif !defined(ARCH_ESP32) // ARCH_RP2040 SPI.begin(); #else - // ESP32 + // ESP32 #if defined(HW_SPI1_DEVICE) SPI1.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); LOG_DEBUG("SPI1.begin(SCK=%d, MISO=%d, MOSI=%d, NSS=%d)", LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); From 2dd4ca8c52e25b289f0c912db19652775640bc06 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 20 Aug 2025 06:01:21 -0500 Subject: [PATCH 2/2] Line --- src/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 42f9c12f7..c6471aa57 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -778,7 +778,6 @@ void setup() // if we have one of the fixed overrides in the settings, adjust display type accordingly. if (screen_model == meshtastic_Config_DisplayConfig_OledType_OLED_SH1107) { screen_geometry = GEOMETRY_128_64; - } else if (screen_model == meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_128) { screen_geometry = GEOMETRY_128_128; }