import upstream maccel baseline
Tests / test_core_function (push) Failing after 12s

This commit is contained in:
2026-03-24 12:10:31 +00:00
parent 6e948d7b39
commit 5f1254d11a
108 changed files with 18930 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#ifndef __SPEED_H__
#define __SPEED_H__
#include "dbg.h"
#include "fixedptc.h"
#include "math.h"
/**
* Track this to enable the UI to show the last noted
* input counts/ms (speed).
*/
static fpt LAST_INPUT_MOUSE_SPEED = 0;
static inline fpt input_speed(fpt dx, fpt dy, fpt time_ms) {
fpt distance = magnitude((struct vector){dx, dy});
if (distance == -1) {
dbg("distance calculation failed: t = %s", fptoa(time_ms));
return 0;
}
dbg("distance (in) %s", fptoa(distance));
fpt speed = fpt_div(distance, time_ms);
LAST_INPUT_MOUSE_SPEED = speed;
dbg("time interval %s", fptoa(time_ms));
dbg("speed (in) %s", fptoa(speed));
return speed;
}
#endif // !__SPEED_H__