Skip to content

Commit 40c586c

Browse files
authored
Automatically bail user out of displaymode_color when not HAS_TFT (meshtastic#7248)
1 parent 7089789 commit 40c586c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/mesh/NodeDB.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,14 @@ NodeDB::NodeDB()
369369
config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_LOCAL_ONLY;
370370
}
371371

372+
#if !HAS_TFT
373+
if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
374+
// On a device without MUI, this display mode makes no sense, and will break logic.
375+
config.display.displaymode = meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT;
376+
config.bluetooth.enabled = true;
377+
}
378+
#endif
379+
372380
if (devicestateCRC != crc32Buffer(&devicestate, sizeof(devicestate)))
373381
saveWhat |= SEGMENT_DEVICESTATE;
374382
if (nodeDatabaseCRC != crc32Buffer(&nodeDatabase, sizeof(nodeDatabase)))

0 commit comments

Comments
 (0)