* Improved QMC driver, scheduled silent interval
* add ODR to drivers and use it to set the quiet period
* add MAG_TASK_RATE debug for testing
* don't do a read if the bus is busy - thanks, Petr
* refactoring and simplification, thanks to Steve
---------
Co-authored-by: Steve Evans <SteveCEvans@users.noreply.github.com>
* Rebased on master and clean-up (untested), this is still the initial method
* Included math.h in compass.c, so checks don't fail
* Change comments, compass is still only running at 167 Hz, not worth investing more
* Alternative method, using only mag data
* Removed unnecessary scaling and fine tuning
* Corrected comment
* Removed no longer needed debug DEBUG_MAG_TASK_RATE, comments and corrected some typos
* Improved readability and update of comment
* Rebased on master and resolved conflicts
* Included math.h and maths.h so checks don't fail
* Update src/main/sensors/compass.c
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
* Update src/main/sensors/compass.h
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
* Update src/main/sensors/compass.c
Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
* Changes according to PR comments
---------
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
* Add mag heading to GPS Rescue heading debug
* Roll and pitch compensated magnetic yaw
* Changes according to PR comments
* Encapsulate yawMag calculations
* Corrected naming
* Changes according to PR comments
* Changes so that Checks don't fail
* Added PARAM_NAME list
* Changes so that Checks don't fail
* Changes according to PR comments
* Update src/main/fc/parameter_names.h
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
* Changes according to PR comments
* 200Hz compass task
* fix wait status flag
* increase default ODR of HMC5883L to 75Hz
* fix spikes in MagYaw debug by re-calc only on new data
---------
Co-authored-by: ctzsnooze <chris.thompson@sydney.edu.au>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Call targetConfiguration() once before config is loaded and again afterwards in case the config needs to be changed to load from SD card etc
Drop SPI clock during binding
Remove debug
Add per device SPI DMA enable
Fix sdioPinConfigure() declaration warning
Reduce clock speed during SPI RX initialisation
The original implementation:
* removed the old 'alignment' variable
* did not require 'ALIGN_CUSTOM'
* always used rotation matrix
* had no additional per-pid-loop conditional logic.
Extract currently unused code into tests.
In preparation for either deleting or re-using in validateAndFixConfig.
Fix code style of some old boardalignment code.
De-duplicate vector rotation code.
Now that rotation code is exacted from `alignBoard` and now doesn't use
`boardRotation` some if it was similar to the code in `rotateV` in
maths.c
Use DECIDEGREES for mag and gyro/acc custom alignments.
Use unnamed structure instead of `values`.
Redefine what 'custom' orientation means.
Move alignment test-only code into the tests.
Ensure gyro/mag custom alignment settings follow the enum variations.
This can't be applied to ALIGN_DEFAULT because, in the case of the MAG,
the default isn't actually known until the gyro is detected, see
`compassDetect`.
OMNIBUSF4/F7 - Don't use ALIGN_DEFAULT in target.h,
common_defaults_post.h does this now.
Comment cleanup.
Delete unused alignment code left from various tests/refactoring
efforts.
* Please do not squash this commit.
Fix SITL build by avoiding structure assignment with anonymous inner
struct.
The error from the build server was as follows:
```./src/main/common/sensor_alignment.c:49:5: error: missing initializer
for field ‘yaw’ of ‘struct <anonymous>’
[-Werror=missing-field-initializers]
*sensorAlignment = CUSTOM_ALIGN_CW0_DEG;
^
In file included from ./src/main/common/sensor_alignment.c:27:0:
./src/main/common/sensor_alignment.h:80:17: note: ‘yaw’ declared here
int16_t yaw;
^
```
Cleanup sensor_alignment API.
Eliminate static variables in mag drivers
AK8975 and HMC5883l driver cleanup
replace magic numbers with definitions
Switched AK8963/Ak8975 to 16 bit mode
Update Mag gain calculations to use integer varables (ledvinap
recomendation)
Update interrupt handling for HMC5883L
Reschedule compass task only if slave mode is realy active
Change bustye definitions to an enumeration set
Fix dispatch functions and remove redundant dispatch functions from Baro
and Mag drivers
Fix unittest