OTA Update added
This commit is contained in:
+38
-26
@@ -27,6 +27,7 @@
|
||||
#include "pulses/pxx1.h"
|
||||
#include "pulses/pxx2.h"
|
||||
#include "modules.h"
|
||||
#include "ff.h"
|
||||
|
||||
#if NUM_MODULES > 1
|
||||
#define IS_RANGECHECK_ENABLE() (moduleState[0].mode == MODULE_MODE_RANGECHECK || moduleState[1].mode == MODULE_MODE_RANGECHECK)
|
||||
@@ -77,7 +78,8 @@ enum ModuleSettingsMode
|
||||
MODULE_MODE_BIND,
|
||||
MODULE_MODE_SHARE,
|
||||
MODULE_MODE_RANGECHECK,
|
||||
MODULE_MODE_RESET
|
||||
MODULE_MODE_RESET,
|
||||
MODULE_MODE_OTA_UPDATE,
|
||||
};
|
||||
|
||||
|
||||
@@ -104,35 +106,44 @@ PACK(struct ModuleInformation {
|
||||
} receivers[PXX2_MAX_RECEIVERS_PER_MODULE];
|
||||
});
|
||||
|
||||
struct ModuleSettings {
|
||||
uint8_t state; // 0x00 = READ 0x40 = WRITE
|
||||
tmr10ms_t retryTime;
|
||||
uint8_t rfProtocol;
|
||||
uint8_t externalAntenna;
|
||||
int8_t txPower;
|
||||
class ModuleSettings {
|
||||
public:
|
||||
uint8_t state; // 0x00 = READ 0x40 = WRITE
|
||||
tmr10ms_t retryTime;
|
||||
uint8_t rfProtocol;
|
||||
uint8_t externalAntenna;
|
||||
int8_t txPower;
|
||||
};
|
||||
|
||||
struct ReceiverSettings {
|
||||
uint8_t state; // 0x00 = READ 0x40 = WRITE
|
||||
tmr10ms_t timeout;
|
||||
uint8_t receiverId;
|
||||
uint8_t dirty;
|
||||
uint8_t telemetryDisabled;
|
||||
uint8_t pwmRate;
|
||||
uint8_t outputsCount;
|
||||
uint8_t outputsMapping[24];
|
||||
class ReceiverSettings {
|
||||
public:
|
||||
uint8_t state; // 0x00 = READ 0x40 = WRITE
|
||||
tmr10ms_t timeout;
|
||||
uint8_t receiverId;
|
||||
uint8_t dirty;
|
||||
uint8_t telemetryDisabled;
|
||||
uint8_t pwmRate;
|
||||
uint8_t outputsCount;
|
||||
uint8_t outputsMapping[24];
|
||||
};
|
||||
|
||||
struct BindInformation {
|
||||
uint8_t step;
|
||||
uint32_t timeout;
|
||||
char candidateReceiversNames[PXX2_MAX_RECEIVERS_PER_MODULE][PXX2_LEN_RX_NAME + 1];
|
||||
uint8_t candidateReceiversCount;
|
||||
uint8_t selectedReceiverIndex;
|
||||
uint8_t rxUid;
|
||||
uint8_t lbtMode;
|
||||
uint8_t flexMode;
|
||||
PXX2HardwareInformation receiverInformation;
|
||||
class BindInformation {
|
||||
public:
|
||||
uint8_t step;
|
||||
uint32_t timeout;
|
||||
char candidateReceiversNames[PXX2_MAX_RECEIVERS_PER_MODULE][PXX2_LEN_RX_NAME + 1];
|
||||
uint8_t candidateReceiversCount;
|
||||
uint8_t selectedReceiverIndex;
|
||||
uint8_t rxUid;
|
||||
uint8_t lbtMode;
|
||||
uint8_t flexMode;
|
||||
PXX2HardwareInformation receiverInformation;
|
||||
};
|
||||
|
||||
class OtaUpdateInformation: public BindInformation {
|
||||
public:
|
||||
char filename[_MAX_LFN+1];
|
||||
uint32_t address;
|
||||
};
|
||||
|
||||
typedef void (* ModuleCallback)();
|
||||
@@ -156,6 +167,7 @@ PACK(struct ModuleState {
|
||||
ModuleInformation * moduleInformation;
|
||||
ModuleSettings * moduleSettings;
|
||||
BindInformation * bindInformation;
|
||||
OtaUpdateInformation * otaUpdateInformation;
|
||||
};
|
||||
ModuleCallback callback;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user