Merge with latest 2.3
This commit is contained in:
+27
-33
@@ -27,7 +27,7 @@
|
||||
#include "pxx1.h"
|
||||
#include "pxx2.h"
|
||||
#include "multi.h"
|
||||
#include "flysky.h"
|
||||
#include "afhds3.h"
|
||||
#include "modules_helpers.h"
|
||||
#include "ff.h"
|
||||
|
||||
@@ -36,12 +36,6 @@
|
||||
extern uint8_t dsm2BindTimer;
|
||||
#endif
|
||||
|
||||
#if defined(PCBFLYSKY)
|
||||
#define IS_FLYSKY_PROTOCOL(protocol) (protocol==PROTO_FLYSKY)
|
||||
#else
|
||||
#define IS_FLYSKY_PROTOCOL(protocol) (0)
|
||||
#endif
|
||||
|
||||
#if defined(DSM2)
|
||||
#define IS_DSM2_PROTOCOL(protocol) (protocol>=PROTOCOL_CHANNELS_DSM2_LP45 && protocol<=PROTOCOL_CHANNELS_DSM2_DSMX)
|
||||
#else
|
||||
@@ -63,29 +57,14 @@
|
||||
#define IS_MULTIMODULE_PROTOCOL(protocol) (0)
|
||||
#endif
|
||||
|
||||
#define IS_SBUS_PROTOCOL(protocol) (protocol == PROTOCOL_CHANNELS_SBUS)
|
||||
#if defined(AFHDS3)
|
||||
#define IS_AFHDS3_PROTOCOL(protocol) (protocol == PROTOCOL_CHANNELS_AFHDS3)
|
||||
#else
|
||||
#define IS_AFHDS3_PROTOCOL(protocol) (0)
|
||||
#endif
|
||||
|
||||
extern uint8_t s_pulses_paused;
|
||||
|
||||
enum ModuleSettingsMode
|
||||
{
|
||||
MODULE_MODE_NORMAL,
|
||||
MODULE_MODE_SPECTRUM_ANALYSER,
|
||||
MODULE_MODE_POWER_METER,
|
||||
MODULE_MODE_GET_HARDWARE_INFO,
|
||||
MODULE_MODE_MODULE_SETTINGS,
|
||||
MODULE_MODE_RECEIVER_SETTINGS,
|
||||
MODULE_MODE_BEEP_FIRST,
|
||||
MODULE_MODE_REGISTER = MODULE_MODE_BEEP_FIRST,
|
||||
MODULE_MODE_BIND,
|
||||
MODULE_MODE_SHARE,
|
||||
MODULE_MODE_RANGECHECK,
|
||||
MODULE_MODE_RESET,
|
||||
MODULE_MODE_AUTHENTICATION,
|
||||
MODULE_MODE_OTA_UPDATE,
|
||||
};
|
||||
|
||||
|
||||
PACK(struct PXX2Version {
|
||||
uint8_t major;
|
||||
uint8_t revision:4;
|
||||
@@ -132,6 +111,7 @@ class ReceiverSettings {
|
||||
uint8_t pwmRate;
|
||||
uint8_t fport;
|
||||
uint8_t enablePwmCh5Ch6;
|
||||
uint8_t fport2;
|
||||
uint8_t outputsCount;
|
||||
uint8_t outputsMapping[24];
|
||||
};
|
||||
@@ -268,6 +248,12 @@ PACK(struct CrossfirePulsesData {
|
||||
uint8_t length;
|
||||
});
|
||||
|
||||
#define GHOST_FRAME_MAXLEN 16
|
||||
PACK(struct GhostPulsesData {
|
||||
uint8_t pulses[GHOST_FRAME_MAXLEN];
|
||||
uint8_t length;
|
||||
});
|
||||
|
||||
union InternalModulePulsesData {
|
||||
#if defined(PXX1)
|
||||
#if defined(INTMODULE_USART)
|
||||
@@ -276,9 +262,7 @@ union InternalModulePulsesData {
|
||||
PwmPxx1Pulses pxx;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(AFHDS2)
|
||||
FlySkySerialPulsesData flysky;
|
||||
#endif
|
||||
|
||||
#if defined(PXX2)
|
||||
Pxx2Pulses pxx2;
|
||||
#endif
|
||||
@@ -311,13 +295,16 @@ union ExternalModulePulsesData {
|
||||
#if defined(DSM2) || defined(MULTIMODULE) || defined(SBUS)
|
||||
Dsm2PulsesData dsm2;
|
||||
#endif
|
||||
|
||||
#if defined(AFHDS3)
|
||||
FlySkySerialPulsesData flysky;
|
||||
afhds3::PulsesData afhds3;
|
||||
#endif
|
||||
|
||||
PpmPulsesData<pulse_duration_t> ppm;
|
||||
|
||||
CrossfirePulsesData crossfire;
|
||||
|
||||
GhostPulsesData ghost;
|
||||
} __ALIGNED(4);
|
||||
|
||||
/* The __ALIGNED keyword is required to align the struct inside the modulePulsesData below,
|
||||
@@ -342,6 +329,7 @@ bool setupPulsesInternalModule();
|
||||
bool setupPulsesExternalModule();
|
||||
void setupPulsesDSM2();
|
||||
void setupPulsesCrossfire();
|
||||
void setupPulsesGhost();
|
||||
void setupPulsesMultiExternalModule();
|
||||
void setupPulsesMultiInternalModule();
|
||||
void setupPulsesSbus();
|
||||
@@ -360,6 +348,11 @@ void extmodulePxx1SerialStart();
|
||||
void extmodulePpmStart();
|
||||
void intmoduleStop();
|
||||
void extmoduleStop();
|
||||
void getModuleStatusString(uint8_t moduleIdx, char * statusText);
|
||||
void getModuleSyncStatusString(uint8_t moduleIdx, char * statusText);
|
||||
#if defined(AFHDS3)
|
||||
uint8_t actualAfhdsRunPower(int moduleIndex);
|
||||
#endif
|
||||
void extramodulePpmStart();
|
||||
|
||||
inline void startPulses()
|
||||
@@ -391,7 +384,8 @@ enum ChannelsProtocols {
|
||||
PROTOCOL_CHANNELS_SBUS,
|
||||
PROTOCOL_CHANNELS_PXX2_LOWSPEED,
|
||||
PROTOCOL_CHANNELS_PXX2_HIGHSPEED,
|
||||
PROTOCOL_CHANNELS_FLYSKY
|
||||
PROTOCOL_CHANNELS_AFHDS3,
|
||||
PROTOCOL_CHANNELS_GHOST
|
||||
};
|
||||
|
||||
inline void stopPulses()
|
||||
@@ -457,4 +451,4 @@ inline bool isModuleInBeepMode()
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // _PULSES_H_
|
||||
#endif // _PULSES_H_
|
||||
|
||||
Reference in New Issue
Block a user