feat: use any source for expo/weight/offset (#5220)
Co-authored-by: philmoz <phil.a.mitchell@gmail.com> Co-authored-by: 3djc <3djc@gh.com> Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
co-authored by
philmoz
3djc
elecpower
parent
326c58a7fd
commit
4b917b762c
@@ -62,26 +62,43 @@
|
||||
|
||||
#include "storage/yaml/yaml_defs.h"
|
||||
|
||||
PACK(union SourceNumVal {
|
||||
struct {
|
||||
int16_t value:10;
|
||||
bool isSource:1;
|
||||
};
|
||||
uint16_t rawValue:11;
|
||||
});
|
||||
|
||||
inline uint16_t makeSourceNumVal(int16_t val, bool isSource = false)
|
||||
{
|
||||
SourceNumVal v;
|
||||
v.value = val;
|
||||
v.isSource= isSource;
|
||||
return v.rawValue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mixer structure
|
||||
*/
|
||||
|
||||
PACK(struct CurveRef {
|
||||
uint8_t type;
|
||||
int8_t value CUST(in_read_weight,in_write_weight);
|
||||
uint16_t type:5;
|
||||
int16_t value:11 CUST(r_sourceNumVal,w_sourceNumVal);
|
||||
});
|
||||
|
||||
PACK(struct MixData {
|
||||
int16_t weight:11 CUST(in_read_weight,in_write_weight); // GV1=-1024, -GV1=1023
|
||||
uint16_t destCh:5;
|
||||
int16_t srcRaw:10 CUST(r_mixSrcRawEx,w_mixSrcRawEx); // srcRaw=0 means not used
|
||||
uint16_t carryTrim:1;
|
||||
uint16_t mixWarn:2; // mixer warning
|
||||
uint16_t mltpx:2 ENUM(MixerMultiplex);
|
||||
uint16_t speedPrec:1;
|
||||
int32_t offset:13 CUST(in_read_weight,in_write_weight);
|
||||
uint16_t flightModes:9 CUST(r_flightModes, w_flightModes);
|
||||
uint16_t spare:2;
|
||||
uint32_t weight:11 CUST(r_sourceNumVal,w_sourceNumVal);
|
||||
uint32_t offset:11 CUST(r_sourceNumVal,w_sourceNumVal);
|
||||
int32_t swtch:10 CUST(r_swtchSrc,w_swtchSrc);
|
||||
uint32_t flightModes:9 CUST(r_flightModes, w_flightModes);
|
||||
CurveRef curve;
|
||||
uint8_t delayUp;
|
||||
uint8_t delayDown;
|
||||
@@ -100,13 +117,14 @@ PACK(struct ExpoData {
|
||||
CUST_ATTR(carryTrim, r_carryTrim, nullptr); //pre 2.9
|
||||
int16_t trimSource:6;
|
||||
int16_t srcRaw:10 ENUM(MixSources) CUST(r_mixSrcRawEx,w_mixSrcRawEx);
|
||||
uint32_t chn:5;
|
||||
uint32_t weight:11 CUST(r_sourceNumVal,w_sourceNumVal);
|
||||
uint32_t offset:11 CUST(r_sourceNumVal,w_sourceNumVal);
|
||||
int32_t swtch:10 CUST(r_swtchSrc,w_swtchSrc);
|
||||
uint32_t flightModes:9 CUST(r_flightModes, w_flightModes);
|
||||
int32_t weight:8 CUST(in_read_weight,in_write_weight);
|
||||
NOBACKUP(char name[LEN_EXPOMIX_NAME]);
|
||||
int8_t offset CUST(in_read_weight,in_write_weight);
|
||||
CurveRef curve;
|
||||
uint16_t chn:5;
|
||||
uint16_t flightModes:9 CUST(r_flightModes, w_flightModes);
|
||||
uint16_t spare:2;
|
||||
NOBACKUP(char name[LEN_EXPOMIX_NAME]);
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user