mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
cleanup eventPage, small optimizations and stricter rules for msp send callbacks
This commit is contained in:
parent
719b47ab48
commit
437fbe2cd0
2 changed files with 7 additions and 9 deletions
|
@ -540,16 +540,16 @@ var MSP = {
|
|||
}
|
||||
|
||||
var obj = {'code': code, 'callback': (callback_msp) ? callback_msp : false};
|
||||
obj.timer = setInterval(function() {
|
||||
obj.timer = setInterval(function () {
|
||||
console.log('MSP data request timed-out: ' + code);
|
||||
|
||||
serial.send(bufferOut, function(sendInfo) {});
|
||||
serial.send(bufferOut, false);
|
||||
}, 1000); // we should be able to define timeout in the future
|
||||
|
||||
MSP.callbacks.push(obj);
|
||||
|
||||
serial.send(bufferOut, function(sendInfo) {
|
||||
if (sendInfo.bytesSent > 0) {
|
||||
serial.send(bufferOut, function (sendInfo) {
|
||||
if (sendInfo.bytesSent == bufferOut.length) {
|
||||
if (callback_sent) callback_sent();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue