1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-25 01:05:15 +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

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

View file

@ -58,6 +58,10 @@ ports.initialize = function (callback) {
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) {
rule.displayName = i18n.getMessage(`portsFunction_${rule.name}`);
}

View file

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

View file

@ -6,6 +6,7 @@ const VtxDeviceTypes = {
// 2 reserved
VTXDEV_SMARTAUDIO: 3,
VTXDEV_TRAMP: 4,
VTXDEV_MSP: 5,
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);