Added universal fix to support OLED for all versions of T-Beam Supreme

This commit is contained in:
Kevin Le committed 2026-07-31 11:57:02 +07:00
1 parent 0cc580afec
commit a54ef6e7cc
2 files changed
+15 -2

No files matched your search

+14 -2
View File
@@ -13,8 +13,20 @@ bool SH1106Display::begin()
{
// Wire must already be initialised by board.begin() before this is called.
// Boards with non-standard SH1106 addresses should define DISPLAY_ADDRESS
// in their variant/platformio configuration.
return i2c_probe(Wire, DISPLAY_ADDRESS) && display.begin(DISPLAY_ADDRESS, true);
// in their variant/platformio configuration. Some board revisions may have
// different solder-bridge address configurations, so variants can also
// provide DISPLAY_ADDRESS_ALT as a fallback.
if (i2c_probe(Wire, DISPLAY_ADDRESS) && display.begin(DISPLAY_ADDRESS, true)) {
return true;
}
#ifdef DISPLAY_ADDRESS_ALT
if (DISPLAY_ADDRESS_ALT != DISPLAY_ADDRESS &&
i2c_probe(Wire, DISPLAY_ADDRESS_ALT) &&
display.begin(DISPLAY_ADDRESS_ALT, true)) {
return true;
}
#endif
return false;
}
void SH1106Display::turnOn()
@@ -19,6 +19,7 @@ build_flags =
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D DISPLAY_CLASS=SH1106Display
-D DISPLAY_ADDRESS=0x3D
-D DISPLAY_ADDRESS_ALT=0x3C
-D LORA_TX_POWER=22
-D P_LORA_TX_LED=6
-D PIN_BOARD_SDA=17