- if less than 6 sides are calibrated, keep the existing calibration and
update the offsets and scales
- if 2 sides are calibrated, estimate the offsets only (as this is enough
if a full calibration was done already, and the problem is not
constrained enough to estimate scales and offsets)
So it is independent from the number of configured sides.
Previously, each side would take longer if less than 6 sides were
calibrated.
Also fixes a bug: calibration_sides was used before it was updated, leading
to different behavior on consecutive calibrations with <6 sides.
Fixes a serious bug in combination with the HMC5883 driver (also used for
HMC5983): this driver estimates a scale in MAGIOCCALIBRATE and applies it.
The calibration routine does the calibration with that scale applied, and
then overwrites it, without considering it in any way.
Most other mag drivers only do some measurements and perform some checks
in MAGIOCCALIBRATE (but the result is just ignored).
It's not required to take that many samples, 1 second is enough.
This is confirmed by looking at the standard deviation over 10 calibrations:
it is in the same order as with 20 seconds (the effect of temperature
increase has a bigger effect).
Before (introduced in 7b16c3482d), there was no colon after
the `R` argument in the options specification string (ab:R).
The R should be followed by a colon, because in indicates that
the R option requires an argument, which it does.
So I added a colon.
As a convenience we send down the amount of do jumps left to do.
However, we should not send the mission item if happen to be in the
middle of another transfer.
This fixes the warning:
Mission storage: Unable to read from microSD
which appeared on do jump mission items. The reason was that the
_mission_type can be set to rally or geofence if that was the last
transfer which had happened earlier. Therefore, it would then try to
read a certain rally item from dataman when really a mission item was
supposed to be read.