A little more tidying. Better notes around how the absolute maximum threshold was arrived at.

This commit is contained in:
Aubrey Hesselgren
2025-07-22 11:01:57 -07:00
committed by Sam Lantinga
parent 8863e5ee67
commit 34616d1b00
3 changed files with 24 additions and 26 deletions

View File

@@ -143,9 +143,12 @@ extern void DestroyGamepadButton(GamepadButton *ctx);
/* Gyro element Display */
/* This is used as the initial noise tolernace threshold. It's set very close to zero to avoid divide by zero while we're evaluating the noise profile. Each controller may have a very different noise profile.*/
/* This is used as the initial noise tolerance threshold. It's set very close to zero to avoid divide by zero while we're evaluating the noise profile. Each controller may have a very different noise profile.*/
#define ACCELEROMETER_NOISE_THRESHOLD 1e-6f
#define ACCELEROMETER_MAX_NOISE_G_SQ ( 0.125f * 0.125f )
/* The value below is based on observation of a Dualshock controller. Of all gamepads observed, the Dualshock (PS4) tends to have one of the noisiest accelerometers. Increase this threshold if a controller is failing to pass the noise profiling stage while stationary on a table. */
#define ACCELEROMETER_MAX_NOISE_G 0.075f
#define ACCELEROMETER_MAX_NOISE_G_SQ (ACCELEROMETER_MAX_NOISE_G * ACCELEROMETER_MAX_NOISE_G)
/* Gyro Calibration Phases */
typedef enum
{