feat: Add support for SpaceMouse mod (6D input knob) (#1853)

Use `-DSPACEMOUSE=YES` CMake option to activate on Horus color targets.
Co-authored-by: Niel Horne (elecpower), Raphael Coeffic (raphaelcoeffic) and Peter Feerick (pfeerick).
This commit is contained in:
Risto
2022-09-18 09:23:48 +02:00
committed by GitHub
co-authored by Niel Horne (elecpower), Raphael Coeffic (raphaelcoeffic) and Peter Feerick (pfeerick).
parent 3765e678b9
commit 9dc4065525
42 changed files with 491 additions and 47 deletions
+18
View File
@@ -195,6 +195,15 @@ bool isSourceAvailable(int source)
return false;
#endif
#if defined(PCBHORUS) && !defined(SPACEMOUSE)
if (source >= MIXSRC_FIRST_SPACEMOUSE && source <= MIXSRC_LAST_SPACEMOUSE)
return false;
#elif defined(PCBHORUS) && defined(SPACEMOUSE)
if ((hasSerialMode(UART_MODE_SPACEMOUSE) == -1) &&
(source >= MIXSRC_FIRST_SPACEMOUSE && source <= MIXSRC_LAST_SPACEMOUSE))
return false;
#endif
if (source >= MIXSRC_FIRST_SWITCH && source <= MIXSRC_LAST_SWITCH) {
return SWITCH_EXISTS(source - MIXSRC_FIRST_SWITCH);
}
@@ -410,6 +419,15 @@ bool isSerialModeAvailable(uint8_t port_nr, int mode)
return false;
#endif
#if !defined(SPACEMOUSE)
if (mode == UART_MODE_SPACEMOUSE)
return false;
#elif defined(USB_SERIAL)
// SPACEMOUSE is not supported on VCP
if (port_nr == SP_VCP && mode == UART_MODE_SPACEMOUSE)
return false;
#endif
#if !defined(LUA)
if (mode == UART_MODE_LUA)
return false;