Tweaked parameters for faster magnetometer calibration
Tweaked parameters for faster magnetometer calibration

These parameters are taken into consideration when
collecting the data samples (the points that we are
going to fit on an ellipsoid).

MIN_DIFF
    Minimum difference between collected points (there
    is no point in collecting events that are similar
    or very close because we won't get a sphere or an
    ellipsoid that way, however a big value doesn't make
    much sense either because the time of collecting a
    certain number of "good" events would increase,
    many would be rejected)

MAX_SQR_ERR
    Maximum allowed error for a calibration, if a
    calibration has an error bigger than this we won't
    allow it.

LOOKBACK_COUNT
    The number of previous events that we consider that
    should be different enough from the current event
    (tightly coupled to the MIN_DIFF parameter).

The smaller the MIN_DIFF and the LOOPBACK_COUNT the faster
a collection is gathered.

The bigger the MAX_SQR_ERR the faster a calibration is accepted.

Testing shows that this new set of parameters leads to a faster
first calibration with no visible user impact on its quality.

Change-Id: Ibe09c02c00975321459d599039d7e4767a880e96
Signed-off-by: Adriana Reus <54192c763ae4f960dbf2b2f913f2990b3167a436@intel.com>
Signed-off-by: Patrick Porlan <6b7a5b9114e07d350ffba0c179039885a7e82794@intel.com>

01org/android-iio-sensors-hal,01org/android-iio-sensors-hal