feat: stick inversion (#6394)
Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
This commit is contained in:
@@ -98,6 +98,7 @@ YamlStickConfig::YamlStickConfig(const GeneralSettings::InputConfig* rhs)
|
||||
for (int i = 0; i < Boards::getCapability(getCurrentBoard(), Board::Inputs); i++) {
|
||||
config[i].tag = std::to_string(i);
|
||||
config[i].type = rhs[i].type;
|
||||
config[i].inverted = rhs[i].inverted;
|
||||
memcpy(config[i].name, rhs[i].name, sizeof(HARDWARE_NAME_LEN));
|
||||
}
|
||||
}
|
||||
@@ -160,10 +161,10 @@ Node convert<InputConfig>::encode(const InputConfig& rhs)
|
||||
{
|
||||
Node node;
|
||||
node["name"] = rhs.name;
|
||||
node["inv"] = (int)rhs.inverted;
|
||||
|
||||
if (rhs.type != Board::AIT_STICK) {
|
||||
node["type"] = potConfigLut << rhs.flexType;
|
||||
node["inv"] = (int)rhs.inverted;
|
||||
}
|
||||
|
||||
return node;
|
||||
|
||||
@@ -430,6 +430,11 @@ void HardwarePanel::addStick(int index)
|
||||
name->setValidator(new NameValidator(board, this));
|
||||
name->setField(config.name, HARDWARE_NAME_LEN, this);
|
||||
params->append(name);
|
||||
|
||||
AutoCheckBox *inverted = new AutoCheckBox(this);
|
||||
inverted->setField(config.inverted, this);
|
||||
params->append(inverted);
|
||||
|
||||
addParams();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user