Skip to content

Commit be20e2e

Browse files
authored
fix(radio): don't check ELRS version if crossfire disabled (#5961)
1 parent efcc29f commit be20e2e

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

radio/src/gui/gui_common.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ uint8_t MENU_FIRST_LINE_EDIT(const uint8_t * horTab, uint8_t horTabMax)
13761376

13771377
uint8_t MODULE_BIND_ROWS(int moduleIdx)
13781378
{
1379-
if (isModuleELRS(moduleIdx) && (crossfireModuleStatus[moduleIdx].major >= 4 || (crossfireModuleStatus[moduleIdx].major == 3 && crossfireModuleStatus[moduleIdx].minor >= 4)))
1379+
if (isModuleELRS(moduleIdx) && CRSF_ELRS_MIN_VER(moduleIdx, 3, 4))
13801380
return 1;
13811381

13821382
if (isModuleCrossfire(moduleIdx))

radio/src/pulses/modules_helpers.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ inline bool isModuleBindRangeAvailable(uint8_t moduleIdx)
619619
return isModulePXX2(moduleIdx) || isModulePXX1(moduleIdx) ||
620620
isModuleDSM2(moduleIdx) || isModuleMultimodule(moduleIdx) ||
621621
isModuleFlySky(moduleIdx) || isModuleDSMP(moduleIdx) ||
622-
(isModuleELRS(moduleIdx) && (crossfireModuleStatus[moduleIdx].major >= 4 || (crossfireModuleStatus[moduleIdx].major == 3 && crossfireModuleStatus[moduleIdx].minor >= 4)));
622+
(isModuleELRS(moduleIdx) && CRSF_ELRS_MIN_VER(moduleIdx, 3, 4));
623623
}
624624

625625
inline uint32_t getNV14RfFwVersion()

radio/src/telemetry/crossfire.h

+4
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,15 @@ const uint8_t CROSSFIRE_FRAME_PERIODS[] = {
156156
% DIM(CROSSFIRE_BAUDRATES)
157157
#endif
158158

159+
#if defined(CROSSFIRE)
159160
#define CRSF_ELRS_MIN_VER(moduleIdx, maj, min) \
160161
(crossfireModuleStatus[moduleIdx].isELRS \
161162
&& (crossfireModuleStatus[moduleIdx].major > maj \
162163
|| (crossfireModuleStatus[moduleIdx].major == maj \
163164
&& crossfireModuleStatus[moduleIdx].minor >= min)))
165+
#else
166+
#define CRSF_ELRS_MIN_VER(moduleIdx, maj, min) false
167+
#endif
164168

165169
#if defined(HARDWARE_INTERNAL_MODULE)
166170
#define INT_CROSSFIRE_BR_IDX CROSSFIRE_STORE_TO_INDEX(g_eeGeneral.internalModuleBaudrate)

0 commit comments

Comments
 (0)