mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-23 16:25:19 +03:00
adaptive intervals
This commit is contained in:
parent
dc40b96238
commit
37738ac269
12 changed files with 87 additions and 9 deletions
|
@ -249,14 +249,14 @@ helper.mspQueue = (function (serial, MSP) {
|
|||
};
|
||||
|
||||
/**
|
||||
* This method return periodic for polling interval that should populate queue in 75% or less
|
||||
* This method return periodic for polling interval that should populate queue in 80% or less
|
||||
* @param {number} requestedInterval
|
||||
* @param {number} messagesInInterval
|
||||
* @returns {number}
|
||||
*/
|
||||
publicScope.getIntervalPrediction = function (requestedInterval, messagesInInterval) {
|
||||
var requestedRate = (1000 / requestedInterval) * messagesInInterval,
|
||||
availableRate = (1000 / publicScope.getRoundtrip()) * 0.75;
|
||||
availableRate = (1000 / publicScope.getRoundtrip()) * 0.8;
|
||||
|
||||
if (requestedRate < availableRate) {
|
||||
return requestedInterval;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue