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:
parent
31dcbbfa91
commit
75e0accf75
4 changed files with 33 additions and 46 deletions
22
tabs/cli.js
22
tabs/cli.js
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue