fix(f4): limit CRSF external module speed to 3.75Mbps (#6923)
Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
@@ -859,3 +859,8 @@ inline bool IS_STM32H7(Board::Type board)
|
||||
IS_JUMPER_T15PRO(board) ||
|
||||
IS_RADIOMASTER_TX15(board);
|
||||
}
|
||||
|
||||
inline bool IS_STM32F2F4(Board::Type board)
|
||||
{
|
||||
return (!IS_STM32H5(board) && !IS_STM32H7(board));
|
||||
}
|
||||
|
||||
@@ -1504,6 +1504,12 @@ bool convert<ModelData>::decode(const Node& node, ModelData& rhs)
|
||||
rhs.moduleData[i].modelId = modelIds[i];
|
||||
}
|
||||
|
||||
// v2.12 CRSF limit external module to 3.75M for older boards
|
||||
if (IS_STM32F2F4(board) &&
|
||||
rhs.moduleData[1].protocol == PULSES_CROSSFIRE &&
|
||||
rhs.moduleData[1].crsf.telemetryBaudrate > 4)
|
||||
rhs.moduleData[1].crsf.telemetryBaudrate = 4;
|
||||
|
||||
if (node["failsafeChannels"]) {
|
||||
int failsafeChans[CPN_MAX_CHNOUT];
|
||||
memset(failsafeChans, 0, sizeof(failsafeChans));
|
||||
|
||||
@@ -641,12 +641,16 @@ AbstractStaticItemModel * ModuleData::protocolItemModel(GeneralSettings & settin
|
||||
return mdl;
|
||||
}
|
||||
|
||||
AbstractStaticItemModel * ModuleData::telemetryBaudrateItemModel(unsigned int protocol)
|
||||
AbstractStaticItemModel * ModuleData::telemetryBaudrateItemModel(unsigned int protocol, int moduleIdx, int board)
|
||||
{
|
||||
AbstractStaticItemModel * mdl = new AbstractStaticItemModel();
|
||||
mdl->setName("moduledata.baudrate");
|
||||
|
||||
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;
|
||||
|
||||
if (protocol == PULSES_GHOST && i >= 2) break;
|
||||
mdl->appendToItemList(moduleBaudratesList.at(i), i);
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ class ModuleData {
|
||||
static AbstractStaticItemModel * internalModuleItemModel(int board = -1);
|
||||
static bool isProtocolAvailable(int moduleidx, unsigned int protocol, GeneralSettings & generalSettings);
|
||||
static AbstractStaticItemModel * protocolItemModel(GeneralSettings & settings);
|
||||
static AbstractStaticItemModel * telemetryBaudrateItemModel(unsigned int protocol);
|
||||
static AbstractStaticItemModel * telemetryBaudrateItemModel(unsigned int protocol, int moduleIdx = -1, int board = 0);
|
||||
static bool isAvailable(PulsesProtocol proto, int port = 0); // moved from OpenTxFirmware EdgeTX v2.9 - TODO remove and use isProtocolAvailable
|
||||
|
||||
QString afhds2aMode1ToString() const;
|
||||
|
||||
Reference in New Issue
Block a user