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:
rotorman
2021-11-19 21:33:03 +01:00
committed by Risto
parent 1002fddd12
commit 80a51837c1
24 changed files with 248 additions and 217 deletions
-9
View File
@@ -126,21 +126,12 @@ do
t16)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T16 -DINTERNAL_MODULE_MULTI=ON"
;;
t16-fs)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T16 -DINTERNAL_MODULE_MULTI=ON -DFLYSKY_HALL_STICKS=ON"
;;
t18)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T18"
;;
t18-fs)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T18 -DFLYSKY_HALL_STICKS=ON"
;;
tx16s)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=TX16S"
;;
tx16s-fs)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=TX16S -DFLYSKY_HALL_STICKS=ON"
;;
nv14)
BUILD_OPTIONS+="-DPCB=NV14"
;;
-14
View File
@@ -31,26 +31,12 @@ boards = {
"INTERNAL_MODULE_MULTI": "YES",
"DEFAULT_MODE": "2",
},
"T16_FS": {
"PCB": "X10",
"PCBREV": "T16",
"INTERNAL_MODULE_MULTI": "YES",
"DEFAULT_MODE": "2",
"FLYSKY_HALL_STICKS": "YES",
},
"T18": {
"PCB": "X10",
"PCBREV": "T18",
"INTERNAL_MODULE_MULTI": "YES",
"DEFAULT_MODE": "2",
},
"T18_FS": {
"PCB": "X10",
"PCBREV": "T18",
"INTERNAL_MODULE_MULTI": "YES",
"DEFAULT_MODE": "2",
"FLYSKY_HALL_STICKS": "YES",
},
}
translations = [
-12
View File
@@ -14,23 +14,11 @@ boards = {
"PCBREV": "TX16S",
"DEFAULT_MODE": "1",
},
"TX16S_1_FS": {
"PCB": "X10",
"PCBREV": "TX16S",
"DEFAULT_MODE": "1",
"FLYSKY_HALL_STICKS": "YES",
},
"TX16S_2": {
"PCB": "X10",
"PCBREV": "TX16S",
"DEFAULT_MODE": "2",
},
"TX16S_2_FS": {
"PCB": "X10",
"PCBREV": "TX16S",
"DEFAULT_MODE": "2",
"FLYSKY_HALL_STICKS": "YES",
},
"TX12_1": {
"PCB": "X7",
"PCBREV": "TX12",
-9
View File
@@ -124,21 +124,12 @@ do
t16)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T16 -DINTERNAL_MODULE_MULTI=ON"
;;
t16-fs)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T16 -DINTERNAL_MODULE_MULTI=ON -DFLYSKY_HALL_STICKS=ON"
;;
t18)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T18"
;;
t18-fs)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T18 -DFLYSKY_HALL_STICKS=ON"
;;
tx16s)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=TX16S"
;;
tx16s-fs)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=TX16S -DFLYSKY_HALL_STICKS=ON"
;;
nv14)
BUILD_OPTIONS+="-DPCB=NV14"
;;
-9
View File
@@ -80,21 +80,12 @@ do
t16)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T16 -DINTERNAL_MODULE_MULTI=ON"
;;
t16-fs)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T16 -DINTERNAL_MODULE_MULTI=ON -DFLYSKY_HALL_STICKS=ON"
;;
t18)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T18"
;;
t18-fs)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T18 -DFLYSKY_HALL_STICKS=ON"
;;
tx16s)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=TX16S -DINTERNAL_GPS=ON"
;;
tx16s-fs)
BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=TX16S -DFLYSKY_HALL_STICKS=ON"
;;
nv14)
BUILD_OPTIONS+="-DPCB=NV14"
;;