mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-19 06:15:11 +03:00
timeout and retry improvements
This commit is contained in:
parent
daf06fa466
commit
4ae45333a8
3 changed files with 22 additions and 7 deletions
|
@ -156,11 +156,6 @@ var MSP = {
|
||||||
bufView,
|
bufView,
|
||||||
i;
|
i;
|
||||||
|
|
||||||
/*
|
|
||||||
* For debug reasons, check how ofter MSP frames are executed
|
|
||||||
*/
|
|
||||||
helper.eventFrequencyAnalyzer.put(code);
|
|
||||||
|
|
||||||
// always reserve 6 bytes for protocol overhead !
|
// always reserve 6 bytes for protocol overhead !
|
||||||
if (data) {
|
if (data) {
|
||||||
var size = data.length + 6,
|
var size = data.length + 6,
|
||||||
|
|
|
@ -56,12 +56,18 @@ helper.mspQueue = (function (serial, MSP) {
|
||||||
*/
|
*/
|
||||||
publicScope.executor = function () {
|
publicScope.executor = function () {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Debug
|
||||||
|
*/
|
||||||
|
helper.eventFrequencyAnalyzer.put("execute");
|
||||||
|
|
||||||
privateScope.loadFilter.apply(privateScope.queue.length);
|
privateScope.loadFilter.apply(privateScope.queue.length);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if port is blocked or there is no connection, do not process the queue
|
* if port is blocked or there is no connection, do not process the queue
|
||||||
*/
|
*/
|
||||||
if (privateScope.portInUse || serial.connectionId === false) {
|
if (privateScope.portInUse || serial.connectionId === false) {
|
||||||
|
helper.eventFrequencyAnalyzer.put("port in use");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,10 +87,18 @@ helper.mspQueue = (function (serial, MSP) {
|
||||||
*/
|
*/
|
||||||
MSP.removeCallback(request.code);
|
MSP.removeCallback(request.code);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* To prevent infinite retry situation, allow retry only while counter is positive
|
||||||
|
*/
|
||||||
|
if (request.retryCounter > 0) {
|
||||||
|
request.retryCounter--;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create new entry in the queue
|
* Create new entry in the queue
|
||||||
*/
|
*/
|
||||||
publicScope.put(request);
|
publicScope.put(request);
|
||||||
|
}
|
||||||
|
|
||||||
}, serial.getTimeout());
|
}, serial.getTimeout());
|
||||||
|
|
||||||
if (request.sentOn === null) {
|
if (request.sentOn === null) {
|
||||||
|
|
|
@ -14,6 +14,12 @@ TABS.cli.initialize = function (callback) {
|
||||||
googleAnalytics.sendAppView('CLI');
|
googleAnalytics.sendAppView('CLI');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Flush MSP queue as well as all MSP registered callbacks
|
||||||
|
*/
|
||||||
|
helper.mspQueue.flush();
|
||||||
|
MSP.callbacks_cleanup();
|
||||||
|
|
||||||
$('#content').load("./tabs/cli.html", function () {
|
$('#content').load("./tabs/cli.html", function () {
|
||||||
// translate to user-selected language
|
// translate to user-selected language
|
||||||
localize();
|
localize();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue