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

MSP VTX device

This commit is contained in:
phobos- 2022-03-29 16:49:14 +02:00
parent b3c38e30e3
commit c4d6b7b0df
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

@ -57,6 +57,10 @@ TABS.ports.initialize = function (callback, scrollPosition) {
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 @@ TABS.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);