feat(radio,cpn): Updates for new joystick system (#3400)
* Reduce RAM usage for advanced joystick system on radio: - Don't allocate memory blocks unless joystick mode is being used. Support multiple radio joystick configurations in Companion: - Save configured joystick settings by joystick name in Companion settings. - Save last joystick name used in each profile. - Reload joystick settings by name when profile is changed. * Only show configuration for used axes and buttons in Companion. Send actual number of configured joystick buttons from radio in USB packet. * Fix issue where USB joystick not recognised if no buttons configured. * Fix compiler warnings. * Remove debugging. * Fix crash in Companion. * Change channel 8 to type 'dial', workaround for Linux mapping issue. --------- Co-authored-by: Phil Mitchell <phil.a.mitchell@gmail.com>
This commit is contained in:
@@ -167,3 +167,13 @@ int Joystick::getAxisValue(int axis)
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Joystick::findCurrent(QString jsName)
|
||||
{
|
||||
for (int i = 0; i < joystickNames.size(); i += 1) {
|
||||
if (joystickNames[i] == jsName) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user