mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 00:05:22 +03:00
Change lexical scope transponder
This commit is contained in:
parent
317f937fd5
commit
dd42f0dc1c
1 changed files with 4 additions and 5 deletions
|
@ -131,7 +131,7 @@ TABS.transponder.initialize = function(callback, scrollPosition) {
|
||||||
//HELPERS
|
//HELPERS
|
||||||
// Convert a hex string to a byte array
|
// Convert a hex string to a byte array
|
||||||
function hexToBytes(hex) {
|
function hexToBytes(hex) {
|
||||||
var bytes = [];
|
const bytes = [];
|
||||||
for ( let c = 0; c < hex.length; c += 2 ) {
|
for ( let c = 0; c < hex.length; c += 2 ) {
|
||||||
bytes.push(~parseInt(hex.substr(c, 2), 16));
|
bytes.push(~parseInt(hex.substr(c, 2), 16));
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ TABS.transponder.initialize = function(callback, scrollPosition) {
|
||||||
|
|
||||||
// Convert a byte array to a hex string
|
// Convert a byte array to a hex string
|
||||||
function bytesToHex(bytes) {
|
function bytesToHex(bytes) {
|
||||||
var hex = [];
|
const hex = [];
|
||||||
for ( let i = 0; i < bytes.length; i++ ) {
|
for ( let i = 0; i < bytes.length; i++ ) {
|
||||||
hex.push(pad(((~bytes[i]) & 0xFF).toString(16), 2));
|
hex.push(pad(((~bytes[i]) & 0xFF).toString(16), 2));
|
||||||
}
|
}
|
||||||
|
@ -155,10 +155,10 @@ TABS.transponder.initialize = function(callback, scrollPosition) {
|
||||||
|
|
||||||
/////////////
|
/////////////
|
||||||
|
|
||||||
function fillByTransponderProviders(transponderProviders, transponderProviderID, toggleTransponderType) {
|
function fillByTransponderProviders(transponderProviders, transponderProviderID, toggleTransponderTypeFn) {
|
||||||
let transponderTypeSelect = $('#transponder_type_select');
|
let transponderTypeSelect = $('#transponder_type_select');
|
||||||
transponderTypeSelect.attr('data-defaultValue', transponderProviderID);
|
transponderTypeSelect.attr('data-defaultValue', transponderProviderID);
|
||||||
transponderTypeSelect.off('change').change(toggleTransponderType);
|
transponderTypeSelect.off('change').change(toggleTransponderTypeFn);
|
||||||
transponderTypeSelect.html('');
|
transponderTypeSelect.html('');
|
||||||
|
|
||||||
//build radio buttons
|
//build radio buttons
|
||||||
|
@ -182,7 +182,6 @@ TABS.transponder.initialize = function(callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildDataBlockForTransponderProviders(transponderProvider, data, clearValue) {
|
function buildDataBlockForTransponderProviders(transponderProvider, data, clearValue) {
|
||||||
var clearValue = clearValue || false;
|
|
||||||
$('#transponderConfiguration').html('');
|
$('#transponderConfiguration').html('');
|
||||||
$('#transponderConfiguration').hide();
|
$('#transponderConfiguration').hide();
|
||||||
$('#transponderHelpBox').hide();
|
$('#transponderHelpBox').hide();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue