1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 04:45:20 +03:00

Show SmartAudio version on VTX tab; MSP reads vtx device status

This commit is contained in:
Ivan Efimov 2021-01-02 02:18:00 -06:00
parent d5d0146af7
commit f872f1375f
12 changed files with 301 additions and 9 deletions

View file

@ -113,6 +113,21 @@ GuiControl.prototype.interval_add = function (name, code, interval, first) {
return data;
};
// name = string
// code = function reference (code to be executed)
// interval = time interval in miliseconds
// first = true/false if code should be ran initially before next timer interval hits
// condition = function reference with true/false result, a condition to be checked before every interval code execution
GuiControl.prototype.interval_add_condition = function (name, code, interval, first, condition) {
this.interval_add(name, () => {
if (condition()) {
code();
} else {
this.interval_remove(name);
}
}, interval, first);
}
// name = string
GuiControl.prototype.interval_remove = function (name) {
for (let i = 0; i < this.interval_array.length; i++) {