[NV14] Add range check button and power level choice (#857)

* add range and high power to MV14

* remove spaces

* fix compilation

* compilation fix 2

* Whitespace cleanup and placate git

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
eshifri
2021-10-13 16:45:52 +11:00
committed by GitHub
co-authored by Peter Feerick
parent cf4a23acc6
commit 7928e5bc20
5 changed files with 53 additions and 4 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ static uint32_t rfRxCount = 0;
static uint8_t lastState = STATE_IDLE;
static uint32_t set_loop_cnt = 0;
uint32_t NV14internalModuleFwVersion;
uint32_t NV14internalModuleFwVersion = 0;
static rf_info_t rf_info = {
.bind_power = BIND_LOW_POWER,
+21 -3
View File
@@ -32,6 +32,10 @@
#include "telemetry/multi.h"
#endif
#if defined(PCBNV14)
extern uint32_t NV14internalModuleFwVersion;
#endif
#define CROSSFIRE_CHANNELS_COUNT 16
#define GHOST_CHANNELS_COUNT 16
@@ -612,11 +616,25 @@ inline bool isModuleBindRangeAvailable(uint8_t moduleIdx)
isModuleFlySky(moduleIdx);
}
inline uint32_t getNV14RfFwVersion()
{
#if defined(PCBNV14)
return NV14internalModuleFwVersion;
#else
return 0;
#endif
}
inline bool isModuleRangeAvailable(uint8_t moduleIdx)
{
return isModuleBindRangeAvailable(moduleIdx)
&& !IS_RX_MULTI(moduleIdx)
&& !isModuleFlySky(moduleIdx);
bool ret = isModuleBindRangeAvailable(moduleIdx) && !IS_RX_MULTI(moduleIdx);
#if defined(PCBNV14)
ret = ret &&
(!isModuleFlySky(moduleIdx) || NV14internalModuleFwVersion >= 0x1000E);
#else
ret = ret && (!isModuleFlySky(moduleIdx));
#endif
return ret;
}
constexpr uint8_t MAX_RXNUM = 63;