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

hookup new cleanup system

This commit is contained in:
cTn 2014-07-10 18:45:18 +02:00
parent 31dcbbfa91
commit 75e0accf75
4 changed files with 33 additions and 46 deletions

View file

@ -85,7 +85,27 @@ tabs.cli.initialize = function(callback) {
};
tabs.cli.cleanup = function(callback) {
if (callback) callback();
var bufferOut = new ArrayBuffer(5);
var bufView = new Uint8Array(bufferOut);
bufView[0] = 0x65; // e
bufView[1] = 0x78; // x
bufView[2] = 0x69; // i
bufView[3] = 0x74; // t
bufView[4] = 0x0D; // enter
serial.send(bufferOut, function(writeInfo) {
// we could handle this "nicely", but this will do for now
// (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() {
CLI_active = false;
CLI_valid = false;
if (callback) callback();
}, 5000); // if we dont allow enough time to reboot, CRC of "first" command sent will fail, keep an eye for this one
});
};
function send_slowly(out_arr, i, timeout_needle) {