1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

GCS/Telemetry Avoid bunching of periodic updates by spreading them.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@738 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
vassilis 2010-06-11 02:24:09 +00:00 committed by vassilis
parent 204f264a6e
commit 7ec7a5f207

View File

@ -29,6 +29,8 @@
#include "telemetry.h"
#include "qxtlogger.h"
#include <QTime>
#include <QtGlobal>
#include <stdlib.h>
/**
* Constructor
@ -112,7 +114,7 @@ void Telemetry::setUpdatePeriod(UAVObject* obj, qint32 periodMs)
if ( objList[n].obj->getObjID() == obj->getObjID() )
{
objList[n].updatePeriodMs = periodMs;
objList[n].timeToNextUpdateMs = 0;
objList[n].timeToNextUpdateMs = quint32((float)periodMs * (float)qrand() / (float)RAND_MAX); // avoid bunching of updates
}
}
}