Adds timing macro

This commit is contained in:
Rune Harlyk
2024-07-14 23:14:07 +02:00
committed by Rune Harlyk
parent c783793b5c
commit 200ea62d95
11 changed files with 41 additions and 62 deletions
+3 -3
View File
@@ -4,6 +4,7 @@
#include <EventSocket.h>
#include <TaskManager.h>
#include <Kinematics.h>
#include <Timing.h>
#include <MathUtils.h>
#define DEFAULT_STATE false
@@ -120,10 +121,9 @@ class MotionService {
}
void loop() {
if (int currentMillis = millis(); !_lastUpdate || (currentMillis - _lastUpdate) >= MotionInterval) {
_lastUpdate = currentMillis;
EXECUTE_EVERY_N_MS(MotionInterval, {
if (updateMotion()) syncAngles();
}
});
}
private: