Revert t variable type to float instead of double

For the sake of simplicity and consistency.
This commit is contained in:
Oleg Kalachev
2025-10-18 12:28:01 +03:00
parent ebac78dc0f
commit e50a9d5fea
11 changed files with 16 additions and 19 deletions

View File

@@ -6,7 +6,7 @@
float loopRate; // Hz
void step() {
double now = micros() / 1000000.0;
float now = micros() / 1000000.0;
dt = now - t;
t = now;
@@ -18,7 +18,7 @@ void step() {
}
void computeLoopRate() {
static double windowStart = 0;
static float windowStart = 0;
static uint32_t rate = 0;
rate++;
if (t - windowStart >= 1) { // 1 second window