diff --git a/companion/src/firmwares/boardjson.cpp b/companion/src/firmwares/boardjson.cpp index da8adead4..3f4d99d41 100644 --- a/companion/src/firmwares/boardjson.cpp +++ b/companion/src/firmwares/boardjson.cpp @@ -214,6 +214,15 @@ const int BoardJson::getCapability(const Board::Capability capability) const case Board::InputSwitches: return m_inputCnt.switches; + case Board::IsF4: + return m_hardware.cpu_type == "STM32F4"; + + case Board::IsH5: + return m_hardware.cpu_type == "STM32H5"; + + case Board::IsH7: + return m_hardware.cpu_type == "STM32H7"; + case Board::JoystickAxes: return m_inputCnt.flexJoystickAxes; @@ -1247,6 +1256,8 @@ bool BoardJson::loadFile(Board::Type board, QString hwdefn, InputsTable * inputs hardware.has_int_module_support = o.value("has_int_module_support").toInt(); hardware.sport_max_baudrate = o.value("sport_max_baudrate").toInt(); hardware.surface = o.value("surface").toInt(); + hardware.cpu = o.value("cpu").toString().toStdString(); + hardware.cpu_type = o.value("cpu_type").toString().toStdString(); } delete json; @@ -1290,3 +1301,15 @@ void BoardJson::setSwitchCounts(const SwitchesTable * switches, SwitchCounts & s switchCounts.func++; } } + +const QString BoardJson::getCapabilityStr(const Board::Capability capability) const +{ + switch (capability) { + case Board::CPU: + return m_hardware.cpu.c_str(); + case Board::CPUType: + return m_hardware.cpu_type.c_str(); + default: + return QString(); + } +} \ No newline at end of file diff --git a/companion/src/firmwares/boardjson.h b/companion/src/firmwares/boardjson.h index 4eb269b11..de3bd74c5 100644 --- a/companion/src/firmwares/boardjson.h +++ b/companion/src/firmwares/boardjson.h @@ -123,6 +123,8 @@ class BoardJson int has_int_module_support = 0; int sport_max_baudrate = 0; int surface = 0; + std::string cpu = ""; + std::string cpu_type = ""; }; typedef std::vector TrimsTable; @@ -136,6 +138,7 @@ class BoardJson bool loadDefinition(); const int getCapability(const Board::Capability capability) const; + const QString getCapabilityStr(const Board::Capability capability) const; const int getInputsCalibrated() const; const int getInputIndex(const QString val, Board::LookupValueType lvt) const; diff --git a/companion/src/firmwares/boards.cpp b/companion/src/firmwares/boards.cpp index 0ddc33ff8..ce3dac081 100644 --- a/companion/src/firmwares/boards.cpp +++ b/companion/src/firmwares/boards.cpp @@ -1182,3 +1182,8 @@ void Boards::tests() { qDebug() << "**** Board checks ****"; } + +QString Boards::getCapabilityStr(Board::Type board, Board::Capability capability) +{ + return getBoardJson(board)->getCapabilityStr(capability); +} \ No newline at end of file diff --git a/companion/src/firmwares/boards.h b/companion/src/firmwares/boards.h index df8f8b1a5..07bbe0739 100644 --- a/companion/src/firmwares/boards.h +++ b/companion/src/firmwares/boards.h @@ -213,6 +213,8 @@ namespace Board { enum Capability { Air, BacklightLevelMin, + CPU, + CPUType, FlexInputs, FlexSwitches, FunctionSwitchColors, @@ -241,6 +243,9 @@ namespace Board { HasVCPSerialMode, Inputs, InputSwitches, + IsF4, + IsH5, + IsH7, JoystickAxes, Joysticks, Keys, @@ -401,12 +406,14 @@ class Boards const int getEEpromSize() const { return getEEpromSize(m_boardType); } const int getFlashSize() const { return getFlashSize(m_boardType); } const int getCapability(Board::Capability capability) const { return getCapability(m_boardType, capability); } + const QString getCapabilityStr(Board::Capability capability) const { return getCapabilityStr(m_boardType, capability); } const bool isBoardCompatible(Board::Type board2) const { return isBoardCompatible(m_boardType, board2); } static uint32_t getFourCC(Board::Type board); static int getEEpromSize(Board::Type board); static int getFlashSize(Board::Type board); static int getCapability(Board::Type board, Board::Capability capability); + static QString getCapabilityStr(Board::Type board, Board::Capability capability); static QString getAxisName(int index); static bool isBoardCompatible(Board::Type board1, Board::Type board2); static QString getBoardName(Board::Type board); @@ -816,17 +823,6 @@ inline bool IS_FAMILY_HORUS_OR_T16(Board::Type board) IS_FLYSKY_PA01(board)/*generally*/ || IS_FLYSKY_NB4P(board)/*generally*/; } -inline bool IS_STM32(Board::Type board) -{ - return IS_TARANIS(board) || IS_FAMILY_HORUS_OR_T16(board) || - IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_FAMILY_PL18(board) || IS_FLYSKY_ST16(board); -} - -inline bool IS_ARM(Board::Type board) -{ - return IS_STM32(board); -} - inline bool HAS_LARGE_LCD(Board::Type board) { return IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X9(board); @@ -854,27 +850,3 @@ inline bool IS_ACCESS_RADIO(Board::Type board, const QString & id) return IS_ACCESS_RADIO(board) || (IS_FAMILY_HORUS_OR_T16(board) && id.contains("internalaccess")); } - -inline bool HAS_EEPROM_YAML(Board::Type board) -{ - return IS_FAMILY_HORUS_OR_T16(board); -} - -inline bool IS_STM32H5(Board::Type board) -{ - return false; -} - -inline bool IS_STM32H7(Board::Type board) -{ - return IS_FLYSKY_PA01(board) || - IS_FLYSKY_ST16(board) || - IS_JUMPER_T15PRO(board) || - IS_RADIOMASTER_TX15(board) || - IS_RADIOMASTER_TX16SMK3(board); -} - -inline bool IS_STM32F2F4(Board::Type board) -{ - return (!IS_STM32H5(board) && !IS_STM32H7(board)); -} diff --git a/companion/src/firmwares/edgetx/yaml_modeldata.cpp b/companion/src/firmwares/edgetx/yaml_modeldata.cpp index 490cc0c0e..5cbdb1309 100644 --- a/companion/src/firmwares/edgetx/yaml_modeldata.cpp +++ b/companion/src/firmwares/edgetx/yaml_modeldata.cpp @@ -1509,7 +1509,7 @@ bool convert::decode(const Node& node, ModelData& rhs) } // v2.12 CRSF limit external module to 3.75M for older boards - if (IS_STM32F2F4(board) && + if (Boards::getCapability((Board::Type)board, Board::IsF4) && rhs.moduleData[1].protocol == PULSES_CROSSFIRE && rhs.moduleData[1].crsf.telemetryBaudrate > 4) rhs.moduleData[1].crsf.telemetryBaudrate = 4; diff --git a/companion/src/firmwares/moduledata.cpp b/companion/src/firmwares/moduledata.cpp index cbadecfca..075734fcb 100644 --- a/companion/src/firmwares/moduledata.cpp +++ b/companion/src/firmwares/moduledata.cpp @@ -611,7 +611,8 @@ AbstractStaticItemModel * ModuleData::telemetryBaudrateItemModel(unsigned int pr for (int i = 0; i < moduleBaudratesList.size(); i++) { // CRSF limit external module to 3.75M for older boards if (protocol == PULSES_CROSSFIRE && moduleIdx == 1 && - IS_STM32F2F4((Board::Type)board) && i > 4) break; + Boards::getCapability((Board::Type)board, Board::IsF4) && + i > 4) break; if (protocol == PULSES_GHOST && i >= 2) break; mdl->appendToItemList(moduleBaudratesList.at(i), i); diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index aa3ca0bcb..2784280a3 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -76,7 +76,7 @@ int OpenTxFirmware::getCapability(::Capability capability) case GlobalFunctions: return CPN_MAX_SPECIAL_FUNCTIONS; case Gvars: - return id.contains("nogvars") ? 0 : (IS_STM32H7(board) || IS_STM32H5(board) ? CPN_MAX_GVARS : 9); + return id.contains("nogvars") ? 0 : (Boards::getCapability((Board::Type)board, Board::IsF4) ? 9 : CPN_MAX_GVARS); case GvarsName: return 3; case Haptic: // TODO remove with X9D @@ -189,7 +189,7 @@ int OpenTxFirmware::getCapability(::Capability capability) case SafetyChannelCustomFunction: return id.contains("nooverridech") ? 0 : 1; case Sensors: - if (IS_STM32H7(board)) + if (Boards::getCapability((Board::Type)board, Board::IsH7)) return CPN_MAX_SENSORS; else if (IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X9(board)) return 60; diff --git a/companion/src/generaledit/generalsetup.cpp b/companion/src/generaledit/generalsetup.cpp index 5355206bf..da6720aae 100644 --- a/companion/src/generaledit/generalsetup.cpp +++ b/companion/src/generaledit/generalsetup.cpp @@ -94,14 +94,7 @@ ui(new Ui::GeneralSetup) ui->gpsFormatCB->setCurrentIndex(generalSettings.gpsFormat); ui->timezoneLE->setTime((generalSettings.timezone * 3600) + (generalSettings.timezoneMinutes/*quarter hours*/ * 15 * 60)); ui->adjustRTC->setChecked(generalSettings.adjustRTC); - - if (IS_STM32(board)) { - ui->usbModeCB->setCurrentIndex(generalSettings.usbMode); - } - else { - ui->usbModeLabel->hide(); - ui->usbModeCB->hide(); - } + ui->usbModeCB->setCurrentIndex(generalSettings.usbMode); if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board) || IS_FAMILY_PL18(board)) { ui->hatsModeCB->setModel(panelFilteredModels->getItemModel(FIM_HATSMODE)); diff --git a/companion/src/modeledit/customfunctions.cpp b/companion/src/modeledit/customfunctions.cpp index 173da9aad..b50a0e971 100644 --- a/companion/src/modeledit/customfunctions.cpp +++ b/companion/src/modeledit/customfunctions.cpp @@ -85,26 +85,22 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model, } } - if (IS_STM32(firmware->getBoard())) { - scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS/FUNCTIONS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength)); - for (int i = 0; i < fswCapability; i++) { - if (functions[i].func == FuncPlayScript) { - QString temp = functions[i].paramarm; - if (!temp.isEmpty()) { - scriptsSet.insert(temp); - } + scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS/FUNCTIONS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength)); + for (int i = 0; i < fswCapability; i++) { + if (functions[i].func == FuncPlayScript) { + QString temp = functions[i].paramarm; + if (!temp.isEmpty()) { + scriptsSet.insert(temp); } } } - if (IS_STM32(firmware->getBoard())) { - scriptsSetRGB = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS/RGBLED", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength)); - for (int i = 0; i < fswCapability; i++) { - if (functions[i].func == FuncRGBLed) { - QString temp = functions[i].paramarm; - if (!temp.isEmpty()) { - scriptsSetRGB.insert(temp); - } + scriptsSetRGB = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS/RGBLED", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength)); + for (int i = 0; i < fswCapability; i++) { + if (functions[i].func == FuncRGBLed) { + QString temp = functions[i].paramarm; + if (!temp.isEmpty()) { + scriptsSetRGB.insert(temp); } } } diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 49ad3d89e..76e6de143 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -116,6 +116,10 @@ string(CONCAT RADIO_NAME "RADIO_" ${RADIO_NAME}) add_definitions(-D${RADIO_NAME}) set(${RADIO_NAME} YES) +add_definitions( + -DCPU_TYPE=${CPU_TYPE} -DCPU_TYPE_FULL=${CPU_TYPE_FULL} +) + set(HW_DESC_JSON ${FLAVOUR}.json) AddHardwareDefTarget(${HW_DESC_JSON}) diff --git a/radio/src/boards/hw_defs/boxer.json b/radio/src/boards/hw_defs/boxer.json index 2e34ff645..c632f83d5 100644 --- a/radio/src/boards/hw_defs/boxer.json +++ b/radio/src/boards/hw_defs/boxer.json @@ -326,6 +326,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/bumblebee.json b/radio/src/boards/hw_defs/bumblebee.json index 24db8e36c..7040bf08d 100644 --- a/radio/src/boards/hw_defs/bumblebee.json +++ b/radio/src/boards/hw_defs/bumblebee.json @@ -395,6 +395,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/commando8.json b/radio/src/boards/hw_defs/commando8.json index 5fffd9c39..132c798a3 100644 --- a/radio/src/boards/hw_defs/commando8.json +++ b/radio/src/boards/hw_defs/commando8.json @@ -275,6 +275,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/el18.json b/radio/src/boards/hw_defs/el18.json index a49f997c4..b853a0598 100644 --- a/radio/src/boards/hw_defs/el18.json +++ b/radio/src/boards/hw_defs/el18.json @@ -340,6 +340,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/f16.json b/radio/src/boards/hw_defs/f16.json index 7d30475de..ee4dc9dca 100644 --- a/radio/src/boards/hw_defs/f16.json +++ b/radio/src/boards/hw_defs/f16.json @@ -434,6 +434,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/gx12.json b/radio/src/boards/hw_defs/gx12.json index 1039bc168..db423db05 100644 --- a/radio/src/boards/hw_defs/gx12.json +++ b/radio/src/boards/hw_defs/gx12.json @@ -436,6 +436,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/lr3pro.json b/radio/src/boards/hw_defs/lr3pro.json index 769ca1313..9991bacf5 100644 --- a/radio/src/boards/hw_defs/lr3pro.json +++ b/radio/src/boards/hw_defs/lr3pro.json @@ -255,6 +255,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/mt12.json b/radio/src/boards/hw_defs/mt12.json index fb7da7fe8..6b9d001e6 100644 --- a/radio/src/boards/hw_defs/mt12.json +++ b/radio/src/boards/hw_defs/mt12.json @@ -304,6 +304,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 1 + "surface": 1, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/nb4p.json b/radio/src/boards/hw_defs/nb4p.json index cdd74cffe..17d7a725c 100644 --- a/radio/src/boards/hw_defs/nb4p.json +++ b/radio/src/boards/hw_defs/nb4p.json @@ -167,6 +167,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/nv14.json b/radio/src/boards/hw_defs/nv14.json index da88d7b28..f7ed73bf1 100644 --- a/radio/src/boards/hw_defs/nv14.json +++ b/radio/src/boards/hw_defs/nv14.json @@ -340,6 +340,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/pa01.json b/radio/src/boards/hw_defs/pa01.json index 2ffb104dd..f6b9563b7 100644 --- a/radio/src/boards/hw_defs/pa01.json +++ b/radio/src/boards/hw_defs/pa01.json @@ -303,6 +303,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32H750xB", + "cpu_type": "STM32H7" } } diff --git a/radio/src/boards/hw_defs/pl18.json b/radio/src/boards/hw_defs/pl18.json index 2c1eca546..1be590ac6 100644 --- a/radio/src/boards/hw_defs/pl18.json +++ b/radio/src/boards/hw_defs/pl18.json @@ -311,6 +311,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/pl18ev.json b/radio/src/boards/hw_defs/pl18ev.json index 395133763..3b735b429 100644 --- a/radio/src/boards/hw_defs/pl18ev.json +++ b/radio/src/boards/hw_defs/pl18ev.json @@ -355,6 +355,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/pl18u.json b/radio/src/boards/hw_defs/pl18u.json index 409801a59..90817a7b1 100644 --- a/radio/src/boards/hw_defs/pl18u.json +++ b/radio/src/boards/hw_defs/pl18u.json @@ -326,6 +326,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/pocket.json b/radio/src/boards/hw_defs/pocket.json index c00b180b2..f965d84be 100644 --- a/radio/src/boards/hw_defs/pocket.json +++ b/radio/src/boards/hw_defs/pocket.json @@ -289,6 +289,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/st16.json b/radio/src/boards/hw_defs/st16.json index 27945035a..05b8cafaa 100644 --- a/radio/src/boards/hw_defs/st16.json +++ b/radio/src/boards/hw_defs/st16.json @@ -403,6 +403,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32H750xB", + "cpu_type": "STM32H7" } } diff --git a/radio/src/boards/hw_defs/t12.json b/radio/src/boards/hw_defs/t12.json index 2fb8106bc..85e3a903e 100644 --- a/radio/src/boards/hw_defs/t12.json +++ b/radio/src/boards/hw_defs/t12.json @@ -331,6 +331,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/t12max.json b/radio/src/boards/hw_defs/t12max.json index 32774b355..575854e0b 100644 --- a/radio/src/boards/hw_defs/t12max.json +++ b/radio/src/boards/hw_defs/t12max.json @@ -289,6 +289,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/t14.json b/radio/src/boards/hw_defs/t14.json index d956649f9..1c82eff91 100644 --- a/radio/src/boards/hw_defs/t14.json +++ b/radio/src/boards/hw_defs/t14.json @@ -289,6 +289,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/t15.json b/radio/src/boards/hw_defs/t15.json index c86a0a5fb..8640d9f92 100644 --- a/radio/src/boards/hw_defs/t15.json +++ b/radio/src/boards/hw_defs/t15.json @@ -369,6 +369,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/t15pro.json b/radio/src/boards/hw_defs/t15pro.json index 5b33d6ddc..e259a1699 100644 --- a/radio/src/boards/hw_defs/t15pro.json +++ b/radio/src/boards/hw_defs/t15pro.json @@ -373,6 +373,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32H750xB", + "cpu_type": "STM32H7" } } diff --git a/radio/src/boards/hw_defs/t16.json b/radio/src/boards/hw_defs/t16.json index b99630a19..ad6b59bbc 100644 --- a/radio/src/boards/hw_defs/t16.json +++ b/radio/src/boards/hw_defs/t16.json @@ -448,6 +448,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/t18.json b/radio/src/boards/hw_defs/t18.json index 70df7d792..436a336f7 100644 --- a/radio/src/boards/hw_defs/t18.json +++ b/radio/src/boards/hw_defs/t18.json @@ -450,6 +450,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/t20.json b/radio/src/boards/hw_defs/t20.json index 3ae93ec91..485d7d64e 100644 --- a/radio/src/boards/hw_defs/t20.json +++ b/radio/src/boards/hw_defs/t20.json @@ -528,6 +528,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/t20v2.json b/radio/src/boards/hw_defs/t20v2.json index 688988099..0cd2f349a 100644 --- a/radio/src/boards/hw_defs/t20v2.json +++ b/radio/src/boards/hw_defs/t20v2.json @@ -528,6 +528,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/t8.json b/radio/src/boards/hw_defs/t8.json index 3e936b29b..3489f713c 100644 --- a/radio/src/boards/hw_defs/t8.json +++ b/radio/src/boards/hw_defs/t8.json @@ -271,6 +271,8 @@ "has_ext_module_support": 0, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/tlite.json b/radio/src/boards/hw_defs/tlite.json index a5c34e9c8..0f40cfc93 100644 --- a/radio/src/boards/hw_defs/tlite.json +++ b/radio/src/boards/hw_defs/tlite.json @@ -255,6 +255,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/tpro.json b/radio/src/boards/hw_defs/tpro.json index b4851d960..bb88c752a 100644 --- a/radio/src/boards/hw_defs/tpro.json +++ b/radio/src/boards/hw_defs/tpro.json @@ -361,6 +361,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/tpros.json b/radio/src/boards/hw_defs/tpros.json index 739640d53..02e15a693 100644 --- a/radio/src/boards/hw_defs/tpros.json +++ b/radio/src/boards/hw_defs/tpros.json @@ -289,6 +289,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/tprov2.json b/radio/src/boards/hw_defs/tprov2.json index eec317916..2473a3b1d 100644 --- a/radio/src/boards/hw_defs/tprov2.json +++ b/radio/src/boards/hw_defs/tprov2.json @@ -389,6 +389,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/tx12.json b/radio/src/boards/hw_defs/tx12.json index 548df461a..287b88c9b 100644 --- a/radio/src/boards/hw_defs/tx12.json +++ b/radio/src/boards/hw_defs/tx12.json @@ -341,6 +341,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/tx12mk2.json b/radio/src/boards/hw_defs/tx12mk2.json index 1f6619d2e..308933a17 100644 --- a/radio/src/boards/hw_defs/tx12mk2.json +++ b/radio/src/boards/hw_defs/tx12mk2.json @@ -318,6 +318,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/tx15.json b/radio/src/boards/hw_defs/tx15.json index 63f3b6277..11ce991a3 100644 --- a/radio/src/boards/hw_defs/tx15.json +++ b/radio/src/boards/hw_defs/tx15.json @@ -343,6 +343,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32H750xB", + "cpu_type": "STM32H7" } } diff --git a/radio/src/boards/hw_defs/tx16s.json b/radio/src/boards/hw_defs/tx16s.json index 00c501ea3..524b953f9 100644 --- a/radio/src/boards/hw_defs/tx16s.json +++ b/radio/src/boards/hw_defs/tx16s.json @@ -456,6 +456,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/tx16smk3.json b/radio/src/boards/hw_defs/tx16smk3.json index f5328ad41..4bdcbb695 100644 --- a/radio/src/boards/hw_defs/tx16smk3.json +++ b/radio/src/boards/hw_defs/tx16smk3.json @@ -457,6 +457,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32H750xB", + "cpu_type": "STM32H7" } } diff --git a/radio/src/boards/hw_defs/v12.json b/radio/src/boards/hw_defs/v12.json index 71977ab48..c5b5b2537 100644 --- a/radio/src/boards/hw_defs/v12.json +++ b/radio/src/boards/hw_defs/v12.json @@ -352,6 +352,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/v14.json b/radio/src/boards/hw_defs/v14.json index ef8bd8df5..f79d83c38 100644 --- a/radio/src/boards/hw_defs/v14.json +++ b/radio/src/boards/hw_defs/v14.json @@ -352,6 +352,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/v16.json b/radio/src/boards/hw_defs/v16.json index b4ebb5330..3170004fe 100644 --- a/radio/src/boards/hw_defs/v16.json +++ b/radio/src/boards/hw_defs/v16.json @@ -454,6 +454,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/x10.json b/radio/src/boards/hw_defs/x10.json index 8b777eb12..9f188f4d3 100644 --- a/radio/src/boards/hw_defs/x10.json +++ b/radio/src/boards/hw_defs/x10.json @@ -454,6 +454,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 250000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/x10express.json b/radio/src/boards/hw_defs/x10express.json index 8b777eb12..9f188f4d3 100644 --- a/radio/src/boards/hw_defs/x10express.json +++ b/radio/src/boards/hw_defs/x10express.json @@ -454,6 +454,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 250000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/x12s.json b/radio/src/boards/hw_defs/x12s.json index 84c23cb72..06e02f7da 100644 --- a/radio/src/boards/hw_defs/x12s.json +++ b/radio/src/boards/hw_defs/x12s.json @@ -447,6 +447,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 250000, - "surface": 0 + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/x7.json b/radio/src/boards/hw_defs/x7.json index 6463d1159..3678ba3e4 100644 --- a/radio/src/boards/hw_defs/x7.json +++ b/radio/src/boards/hw_defs/x7.json @@ -321,6 +321,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 250000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/x7access.json b/radio/src/boards/hw_defs/x7access.json index b042128e5..1c56aa292 100644 --- a/radio/src/boards/hw_defs/x7access.json +++ b/radio/src/boards/hw_defs/x7access.json @@ -307,6 +307,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/x9d+.json b/radio/src/boards/hw_defs/x9d+.json index ec7a53f52..c1432a45b 100644 --- a/radio/src/boards/hw_defs/x9d+.json +++ b/radio/src/boards/hw_defs/x9d+.json @@ -374,6 +374,8 @@ "has_ext_module_support": 1, "has_int_module_support": 0, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/x9d+2019.json b/radio/src/boards/hw_defs/x9d+2019.json index f92c219d0..eef3abf5a 100644 --- a/radio/src/boards/hw_defs/x9d+2019.json +++ b/radio/src/boards/hw_defs/x9d+2019.json @@ -362,6 +362,8 @@ "has_ext_module_support": 1, "has_int_module_support": 0, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/x9d.json b/radio/src/boards/hw_defs/x9d.json index 76b7a7660..89056ea4b 100644 --- a/radio/src/boards/hw_defs/x9d.json +++ b/radio/src/boards/hw_defs/x9d.json @@ -363,6 +363,8 @@ "has_ext_module_support": 1, "has_int_module_support": 0, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/x9e.json b/radio/src/boards/hw_defs/x9e.json index 4e5ea8088..9b016edcf 100644 --- a/radio/src/boards/hw_defs/x9e.json +++ b/radio/src/boards/hw_defs/x9e.json @@ -566,6 +566,8 @@ "has_ext_module_support": 1, "has_int_module_support": 0, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" } } diff --git a/radio/src/boards/hw_defs/x9lite.json b/radio/src/boards/hw_defs/x9lite.json index be4b8f3c2..37b358cb4 100644 --- a/radio/src/boards/hw_defs/x9lite.json +++ b/radio/src/boards/hw_defs/x9lite.json @@ -266,6 +266,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 250000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/x9lites.json b/radio/src/boards/hw_defs/x9lites.json index 7d14b24d9..cab935be9 100644 --- a/radio/src/boards/hw_defs/x9lites.json +++ b/radio/src/boards/hw_defs/x9lites.json @@ -294,6 +294,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 250000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/xlite.json b/radio/src/boards/hw_defs/xlite.json index 94f8c54d8..ec1e33fb6 100644 --- a/radio/src/boards/hw_defs/xlite.json +++ b/radio/src/boards/hw_defs/xlite.json @@ -272,6 +272,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 250000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/xlites.json b/radio/src/boards/hw_defs/xlites.json index a6557867a..0a6983908 100644 --- a/radio/src/boards/hw_defs/xlites.json +++ b/radio/src/boards/hw_defs/xlites.json @@ -300,6 +300,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 250000, - "surface": 0 + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" } } diff --git a/radio/src/boards/hw_defs/zorro.json b/radio/src/boards/hw_defs/zorro.json index 94661f5a2..93b405fc3 100644 --- a/radio/src/boards/hw_defs/zorro.json +++ b/radio/src/boards/hw_defs/zorro.json @@ -342,6 +342,8 @@ "has_ext_module_support": 1, "has_int_module_support": 1, "sport_max_baudrate": 400000, - "surface": 0 + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" } } diff --git a/radio/util/hw_defs/hal_misc.py b/radio/util/hw_defs/hal_misc.py index ae8f8322e..e987b5dfb 100644 --- a/radio/util/hw_defs/hal_misc.py +++ b/radio/util/hw_defs/hal_misc.py @@ -1,13 +1,15 @@ class Misc: - def __init__(self, has_audio_mute, has_bling_leds, has_ext_module_support, has_int_module_support, sport_max_baudrate, surface): + def __init__(self, has_audio_mute, has_bling_leds, has_ext_module_support, has_int_module_support, sport_max_baudrate, surface, cpu, cpu_type): self.has_audio_mute = has_audio_mute self.has_bling_leds = has_bling_leds self.has_ext_module_support = has_ext_module_support self.has_int_module_support = has_int_module_support self.sport_max_baudrate = sport_max_baudrate self.surface = surface + self.cpu = cpu + self.cpu_type = cpu_type def parse_misc(hw_defs): @@ -41,4 +43,14 @@ def parse_misc(hw_defs): else: has_int_module_support = 1 - return Misc(has_audio_mute, has_bling_leds, has_ext_module_support, has_int_module_support, sport_max_baudrate, surface) + if f'CPU_TYPE_FULL' in hw_defs: + cpu = hw_defs[f'CPU_TYPE_FULL'] + else: + cpu = f'Unknown' + + if f'CPU_TYPE' in hw_defs: + cpu_type = hw_defs[f'CPU_TYPE'] + else: + cpu_type = f'Unknown' + + return Misc(has_audio_mute, has_bling_leds, has_ext_module_support, has_int_module_support, sport_max_baudrate, surface, cpu, cpu_type)