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:
@@ -638,6 +638,12 @@ PACK(struct USBJoystickChData {
|
||||
|
||||
#if defined(USBJ_EX)
|
||||
NOBACKUP(
|
||||
uint8_t btnCount() {
|
||||
// Use one less joystick button for 2POS and 3POS switches for Companion mode
|
||||
if ((param == USBJOYS_BTN_MODE_COMPANION) && (switch_npos > 0) && (switch_npos < 3))
|
||||
return switch_npos;
|
||||
return switch_npos + 1;
|
||||
}
|
||||
uint8_t lastBtnNumNoCLip() {
|
||||
uint8_t last = btn_num + switch_npos;
|
||||
// Use one less joystick button for 2POS and 3POS switches for Companion mode
|
||||
|
||||
Reference in New Issue
Block a user