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
+24
View File
@@ -1472,6 +1472,27 @@ int cliGps(const char ** argv)
}
#endif
#if defined(SPACEMOUSE)
int cliSpaceMouse(const char ** argv)
{
#if defined(DEBUG)
if (!strcmp(argv[1], "trace")) {
spacemouseTraceEnabled = !spacemouseTraceEnabled;
} else
#endif
if (!strcmp(argv[1], "poll")) {
spacemousePoll();
} else if (!strcmp(argv[1], "tare")) {
spacemouseTare();
} else if (!strcmp(argv[1], "startstreaming")) {
spacemouseStartStreaming();
} else if (!strcmp(argv[1], "stopstreaming")) {
spacemouseStopStreaming();
}
return 0;
}
#endif
#if defined(BLUETOOTH)
int cliBlueTooth(const char ** argv)
{
@@ -1579,6 +1600,9 @@ const CliCommand cliCommands[] = {
#if defined(INTERNAL_GPS)
{ "gps", cliGps, "<baudrate>|$<command>|trace" },
#endif
#if defined(SPACEMOUSE)
{ "spacemouse", cliSpaceMouse, "poll | tare | startstreaming | stopstreaming | trace" },
#endif
#if defined(BLUETOOTH)
{ "bt", cliBlueTooth, "<baudrate>|<command>" },
#endif