Merge with latest 2.3
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#include "definitions.h"
|
||||
#include "opentx_helpers.h"
|
||||
#include "telemetry/telemetry.h"
|
||||
#include "storage/storage.h"
|
||||
|
||||
#if defined(MULTIMODULE)
|
||||
#include "telemetry/multi.h"
|
||||
#endif
|
||||
@@ -471,11 +473,6 @@ inline bool isModuleBindRangeAvailable(uint8_t moduleIdx)
|
||||
return isModulePXX2(moduleIdx) || isModulePXX1(moduleIdx) || isModuleDSM2(moduleIdx) || isModuleMultimodule(moduleIdx);
|
||||
}
|
||||
|
||||
inline bool isModuleRangeAvailable(uint8_t moduleIdx)
|
||||
{
|
||||
return isModuleXJTD16(moduleIdx) || isModuleXJTLR12(moduleIdx);
|
||||
}
|
||||
|
||||
constexpr uint8_t MAX_RXNUM = 63;
|
||||
|
||||
inline uint8_t getMaxRxNum(uint8_t idx)
|
||||
|
||||
@@ -128,8 +128,10 @@ class ReceiverSettings {
|
||||
uint8_t receiverId;
|
||||
uint8_t dirty;
|
||||
uint8_t telemetryDisabled;
|
||||
uint8_t telemetry25mw;
|
||||
uint8_t pwmRate;
|
||||
uint8_t fport;
|
||||
uint8_t enablePwmCh5Ch6;
|
||||
uint8_t outputsCount;
|
||||
uint8_t outputsMapping[24];
|
||||
};
|
||||
@@ -151,6 +153,7 @@ class OtaUpdateInformation: public BindInformation {
|
||||
public:
|
||||
char filename[FF_MAX_LFN + 1];
|
||||
uint32_t address;
|
||||
uint32_t module;
|
||||
};
|
||||
|
||||
typedef void (* ModuleCallback)();
|
||||
|
||||
@@ -224,6 +224,10 @@ void Pxx2Pulses::setupReceiverSettingsFrame(uint8_t module)
|
||||
flag1 |= PXX2_RX_SETTINGS_FLAG1_FASTPWM;
|
||||
if (reusableBuffer.hardwareAndSettings.receiverSettings.fport)
|
||||
flag1 |= PXX2_RX_SETTINGS_FLAG1_FPORT;
|
||||
if (reusableBuffer.hardwareAndSettings.receiverSettings.telemetry25mw)
|
||||
flag1 |= PXX2_RX_SETTINGS_FLAG1_TELEMETRY_25MW;
|
||||
if (reusableBuffer.hardwareAndSettings.receiverSettings.enablePwmCh5Ch6)
|
||||
flag1 |= PXX2_RX_SETTINGS_FLAG1_ENABLE_PWM_CH5_CH6;
|
||||
Pxx2Transport::addByte(flag1);
|
||||
uint8_t outputsCount = min<uint8_t>(24, reusableBuffer.hardwareAndSettings.receiverSettings.outputsCount);
|
||||
for (int i = 0; i < outputsCount; i++) {
|
||||
@@ -358,6 +362,8 @@ void Pxx2Pulses::sendOtaUpdate(uint8_t module, const char * rxName, uint32_t add
|
||||
|
||||
if (module == EXTERNAL_MODULE)
|
||||
extmoduleSendNextFrame();
|
||||
else if (module == INTERNAL_MODULE)
|
||||
intmoduleSendNextFrame();
|
||||
}
|
||||
|
||||
void Pxx2Pulses::setupAuthenticationFrame(uint8_t module, uint8_t mode, const uint8_t * outputMessage)
|
||||
@@ -467,7 +473,12 @@ const char * Pxx2OtaUpdate::nextStep(uint8_t step, const char * rxName, uint32_t
|
||||
destination->address = address;
|
||||
|
||||
for (uint8_t retry = 0;; retry++) {
|
||||
extmodulePulsesData.pxx2.sendOtaUpdate(module, rxName, address, (const char *) buffer);
|
||||
if (module == EXTERNAL_MODULE) {
|
||||
extmodulePulsesData.pxx2.sendOtaUpdate(module, rxName, address, (const char *) buffer);
|
||||
}
|
||||
else if (module == INTERNAL_MODULE) {
|
||||
intmodulePulsesData.pxx2.sendOtaUpdate(module, rxName, address, (const char *) buffer);
|
||||
}
|
||||
if (waitStep(step + 1, 20)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
+13
-3
@@ -54,6 +54,8 @@
|
||||
#define PXX2_RX_SETTINGS_FLAG1_READONLY (1 << 6)
|
||||
#define PXX2_RX_SETTINGS_FLAG1_FASTPWM (1 << 4)
|
||||
#define PXX2_RX_SETTINGS_FLAG1_FPORT (1 << 3)
|
||||
#define PXX2_RX_SETTINGS_FLAG1_TELEMETRY_25MW (1 << 2)
|
||||
#define PXX2_RX_SETTINGS_FLAG1_ENABLE_PWM_CH5_CH6 (1 << 1)
|
||||
|
||||
#define PXX2_TX_SETTINGS_FLAG0_WRITE (1 << 6)
|
||||
#define PXX2_TX_SETTINGS_FLAG1_EXTERNAL_ANTENNA (1 << 3)
|
||||
@@ -82,7 +84,7 @@ enum PXX2ModuleModelID {
|
||||
PXX2_MODULE_ISRM_S_X10E,
|
||||
PXX2_MODULE_XJT_LITE,
|
||||
PXX2_MODULE_ISRM_S_X10S,
|
||||
PXX2_MODULE_ISRM_S_X9LITE,
|
||||
PXX2_MODULE_ISRM_X9LITES,
|
||||
};
|
||||
|
||||
static const char * const PXX2ModulesNames[] = {
|
||||
@@ -99,7 +101,7 @@ static const char * const PXX2ModulesNames[] = {
|
||||
"ISRM-S-X10E",
|
||||
"XJT Lite",
|
||||
"ISRM-S-X10S",
|
||||
"ISRM-S-X9Lite"
|
||||
"ISRM-X9LiteS"
|
||||
};
|
||||
|
||||
inline const char * getPXX2ModuleName(uint8_t modelId)
|
||||
@@ -141,7 +143,7 @@ static const uint8_t PXX2ModuleOptions[] = {
|
||||
0b00000101, // ISRM-S-X10E
|
||||
0b00000001, // XJT_LITE
|
||||
0b00000101, // ISRM-S-X10S
|
||||
0b00000101, // ISRM-S-X9LITE
|
||||
0b00000100, // ISRM-X9LITES
|
||||
};
|
||||
|
||||
inline uint8_t getPXX2ModuleOptions(uint8_t modelId)
|
||||
@@ -190,6 +192,9 @@ static const char * const PXX2ReceiversNames[] = {
|
||||
"R9-MINI-OTA", // this one has OTA (different bootloader)
|
||||
"R9-MM-OTA", // this one has OTA (different bootloader)
|
||||
"R9-SLIM+-OTA", // this one has OTA (different bootloader)
|
||||
"Archer-X", // this one has OTA (internal module)
|
||||
"R9MX", // this one has OTA
|
||||
"R9SX", // this one has OTA
|
||||
};
|
||||
|
||||
inline const char * getPXX2ReceiverName(uint8_t modelId)
|
||||
@@ -240,6 +245,9 @@ static const uint8_t PXX2ReceiverOptions[] = {
|
||||
0b11111111, // R9-MINI+OTA
|
||||
0b11111111, // R9-MM+OTA
|
||||
0b11111111, // R9-SLIM+OTA
|
||||
0b11111111, // ARCHER-X
|
||||
0b11111111, // R9MX
|
||||
0b11111111, // R9SX
|
||||
};
|
||||
|
||||
inline uint8_t getPXX2ReceiverOptions(uint8_t modelId)
|
||||
@@ -257,6 +265,8 @@ inline bool isPXX2ReceiverOptionAvailable(uint8_t modelId, uint8_t option)
|
||||
|
||||
enum ReceiverCapabilities {
|
||||
RECEIVER_CAPABILITY_FPORT,
|
||||
RECEIVER_CAPABILITY_TELEMETRY_25MW,
|
||||
RECEIVER_CAPABILITY_ENABLE_PWM_CH5_CH6,
|
||||
RECEIVER_CAPABILITY_COUNT
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user