Merge with latest 2.3
This commit is contained in:
+38
-18
@@ -24,8 +24,9 @@
|
||||
#include "definitions.h"
|
||||
#include "dataconstants.h"
|
||||
#include "pulses_common.h"
|
||||
#include "pulses/pxx1.h"
|
||||
#include "pulses/pxx2.h"
|
||||
#include "pxx1.h"
|
||||
#include "pxx2.h"
|
||||
#include "multi.h"
|
||||
#include "modules_helpers.h"
|
||||
#include "ff.h"
|
||||
|
||||
@@ -46,6 +47,12 @@
|
||||
#define IS_DSM2_PROTOCOL(protocol) (0)
|
||||
#endif
|
||||
|
||||
#if defined(DSM2_SERIAL)
|
||||
#define IS_DSM2_SERIAL_PROTOCOL(protocol) (IS_DSM2_PROTOCOL(protocol))
|
||||
#else
|
||||
#define IS_DSM2_SERIAL_PROTOCOL(protocol) (0)
|
||||
#endif
|
||||
|
||||
#if defined(MULTIMODULE)
|
||||
#define IS_MULTIMODULE_PROTOCOL(protocol) (protocol==PROTOCOL_CHANNELS_MULTIMODULE)
|
||||
#if !defined(DSM2)
|
||||
@@ -73,6 +80,7 @@ enum ModuleSettingsMode
|
||||
MODULE_MODE_SHARE,
|
||||
MODULE_MODE_RANGECHECK,
|
||||
MODULE_MODE_RESET,
|
||||
MODULE_MODE_AUTHENTICATION,
|
||||
MODULE_MODE_OTA_UPDATE,
|
||||
};
|
||||
|
||||
@@ -152,7 +160,8 @@ PACK(struct ModuleState {
|
||||
uint8_t paused:1;
|
||||
uint8_t spare:7;
|
||||
uint16_t counter;
|
||||
union {
|
||||
union
|
||||
{
|
||||
ModuleInformation * moduleInformation;
|
||||
ModuleSettings * moduleSettings;
|
||||
ReceiverSettings * receiverSettings;
|
||||
@@ -170,12 +179,14 @@ PACK(struct ModuleState {
|
||||
moduleInformation->maximum = last;
|
||||
mode = MODULE_MODE_GET_HARDWARE_INFO;
|
||||
}
|
||||
|
||||
void readModuleSettings(ModuleSettings * destination)
|
||||
{
|
||||
moduleSettings = destination;
|
||||
moduleSettings->state = PXX2_SETTINGS_READ;
|
||||
mode = MODULE_MODE_MODULE_SETTINGS;
|
||||
}
|
||||
|
||||
void writeModuleSettings(ModuleSettings * source)
|
||||
{
|
||||
moduleSettings = source;
|
||||
@@ -183,12 +194,14 @@ PACK(struct ModuleState {
|
||||
moduleSettings->timeout = 0;
|
||||
mode = MODULE_MODE_MODULE_SETTINGS;
|
||||
}
|
||||
|
||||
void readReceiverSettings(ReceiverSettings * destination)
|
||||
{
|
||||
receiverSettings = destination;
|
||||
receiverSettings->state = PXX2_SETTINGS_READ;
|
||||
mode = MODULE_MODE_RECEIVER_SETTINGS;
|
||||
}
|
||||
|
||||
void writeReceiverSettings(ReceiverSettings * source)
|
||||
{
|
||||
receiverSettings = source;
|
||||
@@ -243,17 +256,21 @@ PACK(struct CrossfirePulsesData {
|
||||
|
||||
union InternalModulePulsesData {
|
||||
#if defined(PXX1)
|
||||
#if defined(INTMODULE_USART)
|
||||
UartPxx1Pulses pxx_uart;
|
||||
#else
|
||||
PwmPxx1Pulses pxx;
|
||||
#endif
|
||||
#if defined(INTMODULE_USART)
|
||||
UartPxx1Pulses pxx_uart;
|
||||
#else
|
||||
PwmPxx1Pulses pxx;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(PXX2)
|
||||
Pxx2Pulses pxx2;
|
||||
#endif
|
||||
|
||||
#if defined(MULTIMODULE) //&& defined(INTMODULE_USART)
|
||||
UartMultiPulses multi;
|
||||
#endif
|
||||
|
||||
#if defined(INTERNAL_MODULE_PPM)
|
||||
PpmPulsesData<pulse_duration_t> ppm;
|
||||
#endif
|
||||
@@ -261,14 +278,14 @@ union InternalModulePulsesData {
|
||||
|
||||
union ExternalModulePulsesData {
|
||||
#if defined(PXX1)
|
||||
#if defined(HARDWARE_EXTERNAL_MODULE_SIZE_SML)
|
||||
UartPxx1Pulses pxx_uart;
|
||||
#endif
|
||||
#if defined(PPM_PIN_SERIAL)
|
||||
SerialPxx1Pulses pxx;
|
||||
#else
|
||||
PwmPxx1Pulses pxx;
|
||||
#endif
|
||||
#if defined(HARDWARE_EXTERNAL_MODULE_SIZE_SML)
|
||||
UartPxx1Pulses pxx_uart;
|
||||
#endif
|
||||
#if defined(PPM_PIN_SERIAL)
|
||||
SerialPxx1Pulses pxx;
|
||||
#else
|
||||
PwmPxx1Pulses pxx;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(PXX2)
|
||||
@@ -300,11 +317,14 @@ union TrainerPulsesData {
|
||||
|
||||
extern TrainerPulsesData trainerPulsesData;
|
||||
|
||||
#if defined(HARDWARE_INTERNAL_MODULE)
|
||||
bool setupPulsesInternalModule();
|
||||
#endif
|
||||
bool setupPulsesExternalModule();
|
||||
void setupPulsesDSM2();
|
||||
void setupPulsesCrossfire();
|
||||
void setupPulsesMultimodule();
|
||||
void setupPulsesMultiExternalModule();
|
||||
void setupPulsesMultiInternalModule();
|
||||
void setupPulsesSbus();
|
||||
void setupPulsesPPMInternalModule();
|
||||
void setupPulsesPPMExternalModule();
|
||||
@@ -416,4 +436,4 @@ inline bool isModuleInBeepMode()
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // _PULSES_H_
|
||||
#endif // _PULSES_H_
|
||||
Reference in New Issue
Block a user