mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-07-23 02:12:17 +00:00
Move Supreme OLED address to variant config
Keep SH1106Display generic by relying on DISPLAY_ADDRESS while the T-Beam Supreme variant declares its 0x3D OLED address.
This commit is contained in:
@@ -11,17 +11,10 @@ bool SH1106Display::i2c_probe(TwoWire &wire, uint8_t addr)
|
||||
|
||||
bool SH1106Display::begin()
|
||||
{
|
||||
// Address selection: on some board revisions (notably the LilyGo T-Beam
|
||||
// Supreme V3) the OLED lives at 0x3D because 0x3C is occupied by a
|
||||
// magnetometer (QMC6310N). 0x3D is only ever used by the OLED, so prefer it
|
||||
// when present, otherwise fall back to the standard 0x3C (DISPLAY_ADDRESS).
|
||||
uint8_t addr = 0;
|
||||
if (i2c_probe(Wire, 0x3D)) {
|
||||
addr = 0x3D;
|
||||
} else if (i2c_probe(Wire, DISPLAY_ADDRESS)) {
|
||||
addr = DISPLAY_ADDRESS;
|
||||
}
|
||||
return addr && display.begin(addr, true);
|
||||
// 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);
|
||||
}
|
||||
|
||||
void SH1106Display::turnOn()
|
||||
|
||||
@@ -18,6 +18,7 @@ build_flags =
|
||||
-D RADIO_CLASS=CustomSX1262
|
||||
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
||||
-D DISPLAY_CLASS=SH1106Display
|
||||
-D DISPLAY_ADDRESS=0x3D
|
||||
-D LORA_TX_POWER=22
|
||||
-D P_LORA_TX_LED=6
|
||||
-D PIN_BOARD_SDA=17
|
||||
|
||||
Reference in New Issue
Block a user