chores(flysky): Separate AFHDS2A and AFHDS3 into 2 different module type (#3783)

* chores(flysky): separate AFHDS2A and AFHDS3 into 2 different module type

This should allow to remove some of the hacks added earlier.

* chore: Add some EL18 CI bits

* fix(afhds): cmake defs

* fix(ci): add el18 to commit-tests.sh

* chore(cpn): separate AFHDS2A and AFHDS3

* chore(cpn): remove binary import of afhds and legacy fxFreq field for afhds3

* fix(cpn): limit available internal afhds protocols to those supported by hardware

* chore(cpn): update Flysky int module test

* fix(cpn): compile error

* fix(cpn): afhds2a max channels

* fix: TR_MODULE_PROTOCOLS

* enh(cpn): more support for afhds2a and 3

* fix(cpn): rebase compile error

* fix(cpn): bit indexes

* fix(cpn): emi toString

* fix(cpn): limit available internal afhds protocols to those supported by hardware

* enh(cpn): add support for Flysky EL18

* fix(cpn): available protocols

* fix(cpn): rebase moduledata

* chore(cpn): add module fields to model print

* Separate AFHDS2A and AFHDS3 UI settings.

* Fix AFHDS3 conversion from old subtype value.
Fix 'Channel Range' layout on portrait LCD.

* Fix name.

---------

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
Co-authored-by: elecpower <neilh713@tpg.com.au>
Co-authored-by: Phil Mitchell <phil.a.mitchell@gmail.com>
This commit is contained in:
Raphael Coeffic
2023-09-07 19:24:03 +10:00
committed by GitHub
co-authored by Peter Feerick elecpower Phil Mitchell
parent 9515d29c9d
commit c4f1e7127d
59 changed files with 1098 additions and 463 deletions
@@ -2211,40 +2211,6 @@ class ModuleUnionField: public UnionField<unsigned int> {
unsigned int version;
};
class Afhds3Field: public UnionField::TransformedMember {
public:
Afhds3Field(DataField * parent, ModuleData& module):
UnionField::TransformedMember(parent, internalField),
internalField(this, "AFHDS3")
{
ModuleData::Afhds3& afhds3 = module.afhds3;
internalField.Append(new UnsignedField<3>(this, minBindPower));
internalField.Append(new UnsignedField<3>(this, afhds3.rfPower));
internalField.Append(new UnsignedField<1>(this, emissionFCC));
internalField.Append(new BoolField<1>(this, operationModeUnicast));
internalField.Append(new BoolField<1>(this, operationModeUnicast));
internalField.Append(new UnsignedField<16>(this, defaultFailSafeTimout));
internalField.Append(new UnsignedField<16>(this, afhds3.rxFreq));
}
bool select(const unsigned int& attr) const override {
return attr == PULSES_AFHDS3;
}
void beforeExport() override {}
void afterImport() override {}
private:
StructField internalField;
unsigned int minBindPower = 0;
unsigned int emissionFCC = 0;
unsigned int defaultFailSafeTimout = 1000;
bool operationModeUnicast = true;
};
class AccessField: public UnionField::TransformedMember {
public:
AccessField(DataField * parent, ModuleData& module):
@@ -2331,7 +2297,6 @@ class ModuleUnionField: public UnionField<unsigned int> {
{
if (version >= 219) {
Append(new AccessField(parent, module));
Append(new Afhds3Field(parent, module));
Append(new GhostField(parent, module));
}
Append(new PxxField(parent, module, version));