1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-26 01:35:28 +03:00

Merge pull request #2965 from phobos-/msp_vtx

VTX Device over MSP
This commit is contained in:
haslinghuis 2022-09-14 17:33:50 +02:00 committed by GitHub
commit 7bf6084b5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 0 deletions

View file

@ -1627,6 +1627,9 @@
"portsFunction_FRSKY_OSD": { "portsFunction_FRSKY_OSD": {
"message": "OSD (FrSky Protocol)" "message": "OSD (FrSky Protocol)"
}, },
"portsFunction_VTX_MSP": {
"message": "VTX (MSP)"
},
"pidTuningProfileOption": { "pidTuningProfileOption": {
"message": "Profile $1" "message": "Profile $1"
}, },
@ -5837,6 +5840,10 @@
"message": "Tramp", "message": "Tramp",
"description": "Text for one of the types of the VTX type in VTX tab" "description": "Text for one of the types of the VTX type in VTX tab"
}, },
"vtxType_5": {
"message": "MSP",
"description": "Text for one of the types of the VTX type in VTX tab"
},
"vtxType_255": { "vtxType_255": {
"message": "Unknown", "message": "Unknown",
"description": "Text for one of the types of the VTX type in VTX tab" "description": "Text for one of the types of the VTX type in VTX tab"

View file

@ -33,6 +33,7 @@ function MspHelper() {
'RUNCAM_DEVICE_CONTROL': 14, // support communitate with RunCam Device 'RUNCAM_DEVICE_CONTROL': 14, // support communitate with RunCam Device
'LIDAR_TF': 15, 'LIDAR_TF': 15,
'FRSKY_OSD': 16, 'FRSKY_OSD': 16,
'VTX_MSP': 17,
}; };
self.REBOOT_TYPES = { self.REBOOT_TYPES = {

View file

@ -58,6 +58,10 @@ ports.initialize = function (callback) {
functionRules.push({ name: 'FRSKY_OSD', groups: ['peripherals'], maxPorts: 1 }); functionRules.push({ name: 'FRSKY_OSD', groups: ['peripherals'], maxPorts: 1 });
} }
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_45)) {
functionRules.push({ name: 'VTX_MSP', groups: ['peripherals'], maxPorts: 1 });
}
for (const rule of functionRules) { for (const rule of functionRules) {
rule.displayName = i18n.getMessage(`portsFunction_${rule.name}`); rule.displayName = i18n.getMessage(`portsFunction_${rule.name}`);
} }

View file

@ -574,6 +574,10 @@ vtx.initialize = function (callback) {
powerMinMax = {min: 1, max: 5}; powerMinMax = {min: 1, max: 5};
break; break;
case VtxDeviceTypes.VTXDEV_MSP:
powerMinMax = {min: 1, max: 5};
break;
case VtxDeviceTypes.VTXDEV_UNKNOWN: case VtxDeviceTypes.VTXDEV_UNKNOWN:
default: default:
powerMinMax = {min: 0, max: 7}; powerMinMax = {min: 0, max: 7};

View file

@ -6,6 +6,7 @@ const VtxDeviceTypes = {
// 2 reserved // 2 reserved
VTXDEV_SMARTAUDIO: 3, VTXDEV_SMARTAUDIO: 3,
VTXDEV_TRAMP: 4, VTXDEV_TRAMP: 4,
VTXDEV_MSP: 5,
VTXDEV_UNKNOWN: 0xFF, VTXDEV_UNKNOWN: 0xFF,
}; };

View file

@ -0,0 +1,19 @@
'use strict';
class VtxDeviceStatusMsp extends VtxDeviceStatus {
constructor(dataView)
{
super(dataView);
dataView.readU8(); // custom device status size
// Read other MSP VTX device parameters here
}
static get staticDeviceStatusType()
{
return VtxDeviceTypes.VTXDEV_MSP;
}
}
vtxDeviceStatusFactory.registerVtxDeviceStatusClass(VtxDeviceStatusMsp);