feat: Flysky PL18 Support (#4105)
Co-authored-by: raphaelcoeffic <raphael.coeffic@frafos.com> Co-authored-by: rotorman <risto.koiva@web.de> Co-authored-by: Xy201207 <yaoxu@flysky.com> Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
raphaelcoeffic
rotorman
Xy201207
Peter Feerick
parent
5153aaeea0
commit
cc17046e7a
@@ -14,14 +14,11 @@ const char* const _key_labels[] = {
|
||||
{% endfor %}
|
||||
};
|
||||
|
||||
constexpr uint32_t _defined_keys =
|
||||
constexpr uint32_t _defined_keys = 0
|
||||
{% for key in keys %}
|
||||
{% if loop.last %}
|
||||
(1 << {{ key.key }});
|
||||
{% else %}
|
||||
(1 << {{ key.key }}) |
|
||||
{% endif %}
|
||||
| (1 << {{ key.key }})
|
||||
{% endfor %}
|
||||
;
|
||||
|
||||
constexpr uint8_t _n_keys = {{ keys | length }};
|
||||
constexpr uint8_t _n_trims = {{ trims | length }};
|
||||
|
||||
@@ -338,6 +338,142 @@ LEGACY_NAMES = [
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"targets": {
|
||||
"pl18"
|
||||
},
|
||||
"inputs": {
|
||||
"LH": {
|
||||
"yaml": "Rud"
|
||||
},
|
||||
"LV": {
|
||||
"yaml": "Ele"
|
||||
},
|
||||
"RV": {
|
||||
"yaml": "Thr"
|
||||
},
|
||||
"RH": {
|
||||
"yaml": "Ail"
|
||||
},
|
||||
"P1": {
|
||||
"yaml": "POT1",
|
||||
"lua": "s1",
|
||||
"label": "S1",
|
||||
"short_label": "1",
|
||||
"description": "Potentiometer 1"
|
||||
},
|
||||
"P2": {
|
||||
"yaml": "POT2",
|
||||
"lua": "s2",
|
||||
"label": "S2",
|
||||
"short_label": "2",
|
||||
"description": "Potentiometer 2"
|
||||
},
|
||||
"P3": {
|
||||
"yaml": "POT3",
|
||||
"lua": "s3",
|
||||
"label": "S3",
|
||||
"short_label": "3",
|
||||
"description": "Potentiometer 3"
|
||||
},
|
||||
"SL1": {
|
||||
"yaml": "LS",
|
||||
"lua": "ls",
|
||||
"label": "LS",
|
||||
"short_label": "L",
|
||||
"description": "Left slider"
|
||||
},
|
||||
"SL2": {
|
||||
"yaml": "RS",
|
||||
"lua": "rs",
|
||||
"label": "RS",
|
||||
"short_label": "R",
|
||||
"description": "Right slider"
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
"targets": {
|
||||
"pl18ev"
|
||||
},
|
||||
"inputs": {
|
||||
"LH": {
|
||||
"yaml": "Rud"
|
||||
},
|
||||
"LV": {
|
||||
"yaml": "Ele"
|
||||
},
|
||||
"RV": {
|
||||
"yaml": "Thr"
|
||||
},
|
||||
"RH": {
|
||||
"yaml": "Ail"
|
||||
},
|
||||
"P1": {
|
||||
"yaml": "POT1",
|
||||
"lua": "s1",
|
||||
"label": "S1",
|
||||
"short_label": "1",
|
||||
"description": "Potentiometer 1"
|
||||
},
|
||||
"P2": {
|
||||
"yaml": "POT2",
|
||||
"lua": "s2",
|
||||
"label": "S2",
|
||||
"short_label": "2",
|
||||
"description": "Potentiometer 2"
|
||||
},
|
||||
"P3": {
|
||||
"yaml": "POT3",
|
||||
"lua": "s3",
|
||||
"label": "S3",
|
||||
"short_label": "3",
|
||||
"description": "Potentiometer 3"
|
||||
},
|
||||
"SL1": {
|
||||
"yaml": "LS",
|
||||
"lua": "ls",
|
||||
"label": "LS",
|
||||
"short_label": "L",
|
||||
"description": "Left slider"
|
||||
},
|
||||
"SL2": {
|
||||
"yaml": "RS",
|
||||
"lua": "rs",
|
||||
"label": "RS",
|
||||
"short_label": "R",
|
||||
"description": "Right slider"
|
||||
},
|
||||
"EXT1": {
|
||||
"yaml": "EXT1",
|
||||
"lua": "ext1",
|
||||
"label": "EXT1",
|
||||
"short_label": "E1",
|
||||
"description": "Ext 1"
|
||||
},
|
||||
"EXT2": {
|
||||
"yaml": "EXT2",
|
||||
"lua": "ext2",
|
||||
"label": "EXT2",
|
||||
"short_label": "E2",
|
||||
"description": "Ext 2"
|
||||
},
|
||||
"EXT3": {
|
||||
"yaml": "EXT3",
|
||||
"lua": "ext3",
|
||||
"label": "EXT3",
|
||||
"short_label": "E3",
|
||||
"description": "Ext 3"
|
||||
},
|
||||
"EXT4": {
|
||||
"yaml": "EXT4",
|
||||
"lua": "ext4",
|
||||
"label": "EXT4",
|
||||
"short_label": "E4",
|
||||
"description": "Ext 4"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"targets": {"t20"},
|
||||
"inputs": {
|
||||
|
||||
@@ -14,6 +14,24 @@ POT_CONFIG = {
|
||||
"P1": {"default": "POT_CENTER"},
|
||||
"P2": {"default": "POT_CENTER"}
|
||||
},
|
||||
"pl18": {
|
||||
"P1": {"default": "POT"},
|
||||
"P2": {"default": "POT"},
|
||||
"P3": {"default": "POT"},
|
||||
"SL1": {"default": "SLIDER"},
|
||||
"SL2": {"default": "SLIDER"}
|
||||
},
|
||||
"pl18ev": {
|
||||
"P1": {"default": "POT_CENTER"},
|
||||
"P2": {"default": "POT"},
|
||||
"P3": {"default": "POT_CENTER"},
|
||||
"SL1": {"default": "SLIDER"},
|
||||
"SL2": {"default": "SLIDER"},
|
||||
"EXT1": {"default": "POT_CENTER"},
|
||||
"EXT2": {"default": "POT_CENTER"},
|
||||
"EXT3": {"default": "MULTIPOS"},
|
||||
"EXT4": {"default": "MULTIPOS"}
|
||||
},
|
||||
"mt12": {
|
||||
"P1": {"default": "POT"},
|
||||
"P2": {"default": "POT"},
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
static const stm32_adc_input_t _ADC_inputs[] = {
|
||||
{% for input in adc_inputs.inputs %}
|
||||
{
|
||||
// {{ input.name }}
|
||||
// ADC_INPUT_{{ input.type }},
|
||||
{{ input.gpio if input.gpio else 'nullptr' }},
|
||||
{{ input.pin if input.gpio else '0' }},
|
||||
|
||||
@@ -29,6 +29,28 @@ SWITCH_CONFIG = {
|
||||
"SG": { "default": "3POS" },
|
||||
"SH": { "default": "TOGGLE" }
|
||||
},
|
||||
"pl18": {
|
||||
"SA": { "default": "2POS" },
|
||||
"SB": { "default": "3POS" },
|
||||
"SC": { "default": "2POS" },
|
||||
"SD": { "default": "3POS" },
|
||||
"SE": { "default": "3POS" },
|
||||
"SF": { "default": "2POS" },
|
||||
"SG": { "default": "3POS" },
|
||||
"SH": { "default": "TOGGLE" }
|
||||
},
|
||||
"pl18ev": {
|
||||
"SA": { "default": "2POS" },
|
||||
"SB": { "default": "3POS" },
|
||||
"SC": { "default": "2POS" },
|
||||
"SD": { "default": "3POS" },
|
||||
"SE": { "default": "3POS" },
|
||||
"SF": { "default": "2POS" },
|
||||
"SG": { "default": "3POS" },
|
||||
"SH": { "default": "3POS" },
|
||||
"SI": { "default": "3POS" },
|
||||
"SJ": { "default": "3POS" }
|
||||
},
|
||||
"lr3pro": {
|
||||
# left side
|
||||
"SA": {"default": "3POS", "display": [0, 0]},
|
||||
|
||||
Reference in New Issue
Block a user