Automatically detect FlySky digital hall sticks on X10-class radios without necessity of build-time CMake option FLYSKY_HALL_STICKS.
Added special UART4 init to sample if FlySky sticks are present or not. Added boolean globalData.flyskygimbals to save the detection result. Removed FLYSKY_HALL_STICKS and FLYSKY_HALL_STICKS_REVERSE CMake build options. Tested on two RM TX16S radios, one with FlySky digital hall sticks and second with stock analog sticks.
This commit is contained in:
@@ -60,8 +60,11 @@ void interrupt1ms()
|
||||
++pre_scale;
|
||||
|
||||
// 1 ms loop
|
||||
#if defined(FLYSKY_HALL_STICKS) && !defined(SIMU)
|
||||
flysky_hall_stick_loop(); // TODO: need to put in 1ms timer loop for best performance
|
||||
#if not defined(SIMU) && (defined(RADIO_FAMILY_T16) || defined(PCBNV14))
|
||||
if (globalData.flyskygimbals)
|
||||
{
|
||||
flysky_hall_stick_loop();
|
||||
}
|
||||
#endif
|
||||
|
||||
// 5ms loop
|
||||
|
||||
Reference in New Issue
Block a user