mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-24 08:45:28 +03:00
Support no symbol for older versions of Betaflight in the OSD preview
This commit is contained in:
parent
16b841eb9c
commit
c392f4abe9
1 changed files with 7 additions and 5 deletions
|
@ -19,9 +19,9 @@ SYM.AMP = 0x9A;
|
|||
SYM.MAH = 0x07;
|
||||
SYM.METRE = 0xC;
|
||||
SYM.FEET = 0xF;
|
||||
SYM.KPH = function() { return semver.gte(CONFIG.apiVersion, "1.42.0") ? 0x9E : 0x4B };
|
||||
SYM.MPH = function() { return semver.gte(CONFIG.apiVersion, "1.42.0") ? 0x9D : 0x4D };
|
||||
SYM.SPEED = 0x70;
|
||||
SYM.KPH = 0x9E;
|
||||
SYM.MPH = 0x9D;
|
||||
SYM.SPEED = function() { return semver.gte(CONFIG.apiVersion, "1.42.0") ? 0x70 : '' };
|
||||
SYM.TOTAL_DIST = 0x71;
|
||||
SYM.GPS_SAT_L = 0x1E;
|
||||
SYM.GPS_SAT_R = 0x1F;
|
||||
|
@ -242,11 +242,13 @@ FONT.preview = function ($el) {
|
|||
};
|
||||
|
||||
FONT.symbol = function (hexVal) {
|
||||
let charCode;
|
||||
if (typeof(hexVal) === 'function') {
|
||||
return String.fromCharCode(hexVal());
|
||||
charCode = hexVal();
|
||||
} else {
|
||||
return String.fromCharCode(hexVal);
|
||||
charCode = hexVal;
|
||||
}
|
||||
return (charCode == '' || charCode == null)? '' : String.fromCharCode(charCode);
|
||||
};
|
||||
|
||||
var OSD = OSD || {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue