mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 21:35:33 +03:00
Remove magic number, add TIMEOUT_CHECK constant
This commit is contained in:
parent
acc035a61a
commit
f2002468c6
1 changed files with 4 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const TIMEOUT_CHECK = 500; // With 250 it seems that it produces a memory leak and slowdown in some versions, reason unknown
|
||||||
|
|
||||||
var usbDevices = { filters: [
|
var usbDevices = { filters: [
|
||||||
{'vendorId': 1155, 'productId': 57105},
|
{'vendorId': 1155, 'productId': 57105},
|
||||||
{'vendorId': 10473, 'productId': 393}
|
{'vendorId': 10473, 'productId': 393}
|
||||||
|
@ -13,7 +15,7 @@ var PortHandler = new function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
PortHandler.initialize = function () {
|
PortHandler.initialize = function () {
|
||||||
// start listening, check after 250ms
|
// start listening, check after TIMEOUT_CHECK ms
|
||||||
this.check();
|
this.check();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -142,7 +144,7 @@ PortHandler.check = function () {
|
||||||
GUI.updateManualPortVisibility();
|
GUI.updateManualPortVisibility();
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
self.check();
|
self.check();
|
||||||
}, 500);
|
}, TIMEOUT_CHECK);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue