mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 09:39:33 +00:00
Rename flushParameters to more clear syncParameters
This commit is contained in:
parent
acc0274175
commit
8d7a4595f5
@ -67,5 +67,5 @@ void loop() {
|
||||
processMavlink();
|
||||
#endif
|
||||
logData();
|
||||
flushParameters();
|
||||
syncParameters();
|
||||
}
|
||||
|
@ -107,11 +107,11 @@ bool setParameter(const char *name, const float value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void flushParameters() {
|
||||
static float lastFlush = 0;
|
||||
if (t - lastFlush < 1) return; // flush once per second
|
||||
void syncParameters() {
|
||||
static float lastSync = 0;
|
||||
if (t - lastSync < 1) return; // sync once per second
|
||||
if (motorsActive()) return; // don't use flash while flying, it may cause a delay
|
||||
lastFlush = t;
|
||||
lastSync = t;
|
||||
|
||||
for (auto ¶meter : parameters) {
|
||||
if (parameter.value == *parameter.variable) continue;
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
applyMotorForces();
|
||||
publishTopics();
|
||||
logData();
|
||||
flushParameters();
|
||||
syncParameters();
|
||||
}
|
||||
|
||||
void applyMotorForces() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user