fix(radio): invalid memory access if SpaceMouse input present but not supported (#4686)

i.e. somehow the input has been specified but not has not been specified as a option in the firmware
This commit is contained in:
philmoz
2024-03-06 10:31:04 +10:00
committed by GitHub
parent 8cd899f9b4
commit 5f32648b21
+5 -1
View File
@@ -360,9 +360,13 @@ getvalue_t getValue(mixsrc_t i, bool* valid)
}
#endif
#if defined(SPACEMOUSE)
#if defined(PCBHORUS)
else if (i >= MIXSRC_FIRST_SPACEMOUSE && i <= MIXSRC_LAST_SPACEMOUSE) {
#if defined(SPACEMOUSE)
return get_spacemouse_value(i - MIXSRC_FIRST_SPACEMOUSE);
#else
return 0;
#endif
}
#endif