chore: Companion - port of OpenTX function switches management (#1694)
* TPro - Port of OpenTX function switches management (https://github.com/opentx/opentx/pull/8847) * cleanup * Corrections * Fix YAML generation and adjusted switches to match TPRO firmware Co-authored-by: Batam <batam@macbook-pro.home>
This commit is contained in:
@@ -305,6 +305,24 @@ void Helpers::exportAppSettings(QWidget * dlgParent)
|
||||
exportAppSettings(dlgParent);
|
||||
}
|
||||
|
||||
unsigned int Helpers::getBitmappedValue(const unsigned int & field, const unsigned int index, const unsigned int numbits, const unsigned int offset)
|
||||
{
|
||||
int mask = -1;
|
||||
mask = mask << numbits;
|
||||
mask = ~mask;
|
||||
return (field >> (numbits * index + offset)) & (unsigned int)mask;
|
||||
}
|
||||
|
||||
void Helpers::setBitmappedValue(unsigned int & field, unsigned int value, unsigned int index, unsigned int numbits, unsigned int offset)
|
||||
{
|
||||
int mask = -1;
|
||||
mask = mask << numbits;
|
||||
mask = ~mask;
|
||||
|
||||
unsigned int fieldmask = ((unsigned int)mask << (numbits * index + offset));
|
||||
field = (field & ~fieldmask) | (value << (numbits * index + offset));
|
||||
}
|
||||
|
||||
void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
|
||||
{
|
||||
QString fwId = SimulatorLoader::findSimulatorByFirmwareName(getCurrentFirmware()->getId());
|
||||
|
||||
Reference in New Issue
Block a user