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

timing methods extracted to separate classes

This commit is contained in:
Pawel Spychalski (DzikuVx) 2017-01-18 15:54:45 +01:00
parent fc11eca5c0
commit d1fcb81017
26 changed files with 262 additions and 219 deletions

View file

@ -55,7 +55,7 @@ TABS.cli.initialize = function (callback) {
// give input element user focus
textarea.focus();
GUI.timeout_add('enter_cli', function enter_cli() {
helper.timeout.add('enter_cli', function enter_cli() {
// Enter CLI mode
var bufferOut = new ArrayBuffer(1);
var bufView = new Uint8Array(bufferOut);
@ -88,7 +88,7 @@ TABS.cli.history.next = function () {
};
TABS.cli.sendSlowly = function (out_arr, i, timeout_needle) {
GUI.timeout_add('CLI_send_slowly', function () {
helper.timeout.add('CLI_send_slowly', function () {
var bufferOut = new ArrayBuffer(out_arr[i].length + 1);
var bufView = new Uint8Array(bufferOut);
@ -202,7 +202,7 @@ TABS.cli.cleanup = function (callback) {
// (another approach is however much more complicated):
// we can setup an interval asking for data lets say every 200ms, when data arrives, callback will be triggered and tab switched
// we could probably implement this someday
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
helper.timeout.add('waiting_for_bootup', function waiting_for_bootup() {
if (callback) callback();
}, 1000); // if we dont allow enough time to reboot, CRC of "first" command sent will fail, keep an eye for this one
CONFIGURATOR.cliActive = false;