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

Added support for RSSI & Link Quality warning settings & Link Quality alarm setting.

This commit is contained in:
Ian Murphy 2019-04-14 12:17:58 +01:00
parent 2c7d47bbdc
commit 9463e08f10
2 changed files with 34 additions and 4 deletions

View file

@ -263,7 +263,8 @@ OSD.initData = function () {
preview_logo: true,
preview: [],
tooltips: [],
osd_profiles: {}
osd_profiles: {},
overlay_mode: null,
};
};
OSD.initData();
@ -1107,8 +1108,15 @@ OSD.constants = {
GPS_RESCUE_DISABLED: {
name: 'GPS_RESCUE_DISABLED',
desc: 'osdWarningGpsRescueDisabled'
}
},
RSSI: {
name: 'RSSI',
desc: 'osdWarningRSSI'
},
LINK_QUALITY: {
name: 'LINK_QUALITY',
desc: 'osdWarningLinkQuality'
},
},
FONT_TYPES: [
{ file: "default", name: "Default" },
@ -1365,6 +1373,12 @@ OSD.chooseFields = function () {
F.GPS_RESCUE_DISABLED
]);
}
if (semver.gte(CONFIG.apiVersion, "1.42.0")) {
OSD.constants.WARNINGS = OSD.constants.WARNINGS.concat([
F.RSSI,
F.LINK_QUALITY
]);
}
};
OSD.updateDisplaySize = function () {
@ -1487,8 +1501,12 @@ OSD.msp = {
result.push16(warningFlags);
if (semver.gte(CONFIG.apiVersion, "1.41.0")) {
result.push32(warningFlags);
// NOTE: betaflight MSP does not expect result.push8(OSD.data.osd_profiles.number);
result.push8(OSD.data.osd_profiles.selected + 1);
result.push8(OSD.data.overlay_mode);
}
if (semver.gte(CONFIG.apiVersion, "1.42.0")) {
result.push8(OSD.data.alarms.link_quality.value);
}
}
@ -1636,11 +1654,17 @@ OSD.msp = {
if (semver.gte(CONFIG.apiVersion, "1.41.0")) {
d.osd_profiles.number = view.readU8();
d.osd_profiles.selected = view.readU8() - 1;
d.overlay_mode = view.readU8();
} else {
d.osd_profiles.number = 1;
d.osd_profiles.selected = 0;
}
// Link Quality Alarm
if (semver.gte(CONFIG.apiVersion, "1.42.0")) {
d.alarms['link_quality'] = { display_name: 'Link Quality', value: view.readU8() };
}
// Now we have the number of profiles, process the OSD elements
for (let item of items_positions_read) {
var j = d.display_items.length;