diff --git a/companion/src/firmwares/boards.cpp b/companion/src/firmwares/boards.cpp index ce3dac081..ed09b646d 100644 --- a/companion/src/firmwares/boards.cpp +++ b/companion/src/firmwares/boards.cpp @@ -336,6 +336,10 @@ int Boards::getCapability(Board::Type board, Board::Capability capability) return (IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS(board) || IS_RADIOMASTER_TX15(board)); + case HasInternalGPS: + return ((IS_FAMILY_HORUS_OR_T16(board) && getCapability(board, HasAuxSerialMode)) || + IS_RADIOMASTER_TX15(board) || IS_RADIOMASTER_TX16SMK3); + case HasSoftwareSerialPower: return IS_RADIOMASTER_TX16S(board); diff --git a/companion/src/firmwares/boards.h b/companion/src/firmwares/boards.h index 860ac9e08..269f24c5b 100644 --- a/companion/src/firmwares/boards.h +++ b/companion/src/firmwares/boards.h @@ -226,13 +226,14 @@ namespace Board { HasAuxSerialMode, HasAux2SerialMode, HasBacklightColor, + HasBlingLEDS, HasBluetooth, HasColorLcd, HasExternalModuleSupport, HasIMU, + HasInternalGPS, HasInternalModuleSupport, HasIntModuleHeartbeatGPIO, - HasBlingLEDS, HasRTC, HasSDCard, HasSoftwareSerialPower, diff --git a/companion/src/firmwares/modeldata.cpp b/companion/src/firmwares/modeldata.cpp index 67ee20b2e..fe1f25041 100644 --- a/companion/src/firmwares/modeldata.cpp +++ b/companion/src/firmwares/modeldata.cpp @@ -308,8 +308,14 @@ void ModelData::clear() sensorData[i].clear(); toplcdTimer = 0; - RadioLayout::init("Layout2P1", customScreens); - topBarData.clear(); + + if (Boards::getCapability(getCurrentBoard(), Board::HasColorLcd)) { + RadioLayout::init("Layout2P1", customScreens); + initTopBar(); + } else { + customScreens.clear(); + topBarData.clear(); + } for (int i = 0; i < MAX_TOPBAR_ZONES; i++) topbarWidgetWidth[i] = 1; @@ -2307,3 +2313,24 @@ void ModelData::updateSourceNumRef(int & value) updateSourceIntRef(value); } } + +void ModelData::initTopBar() +{ + topBarData.clear(); + int zones = RadioLayout::topBarZones(); + + if (zones - 1 >= 0) { + ZonePersistentData & zone = topBarData.zones[zones - 1]; + zone.widgetName = "Date Time"; + } + + if (zones - 2 >= 0) { + ZonePersistentData & zone = topBarData.zones[zones - 2]; + zone.widgetName = "Radio Info"; + } + + if (zones - 3 >= 0 && Boards::getCapability(getCurrentBoard(), Board::HasInternalGPS)) { + ZonePersistentData & zone = topBarData.zones[zones - 3]; + zone.widgetName = "Internal GPS"; + } +} diff --git a/companion/src/firmwares/modeldata.h b/companion/src/firmwares/modeldata.h index 753ecf779..cc7e51b55 100644 --- a/companion/src/firmwares/modeldata.h +++ b/companion/src/firmwares/modeldata.h @@ -435,4 +435,5 @@ class ModelData { } void updateResetParam(CustomFunctionData * cfd); void updateSourceNumRef(int & value); + void initTopBar(); };