Wismy/frsky new receivers (#7449)
Add internal module OTA Change virtual keys for X-Lite(S) Lua scripts
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
|
||||
|
||||
@@ -121,8 +121,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];
|
||||
};
|
||||
@@ -144,6 +146,7 @@ class OtaUpdateInformation: public BindInformation {
|
||||
public:
|
||||
char filename[_MAX_LFN + 1];
|
||||
uint32_t address;
|
||||
uint32_t module;
|
||||
};
|
||||
|
||||
typedef void (* ModuleCallback)();
|
||||
|
||||
@@ -223,6 +223,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++) {
|
||||
@@ -355,6 +359,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)
|
||||
@@ -464,7 +470,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
@@ -53,6 +53,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)
|
||||
@@ -81,7 +83,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[] = {
|
||||
@@ -98,7 +100,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)
|
||||
@@ -140,7 +142,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)
|
||||
@@ -189,6 +191,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)
|
||||
@@ -239,6 +244,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)
|
||||
@@ -256,6 +264,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