-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add magnetic heading as debug and magnetic declination for the Mahony filter #13073
Merged
haslinghuis
merged 16 commits into
betaflight:master
from
pichim:dev_add_magnetic_declination
Sep 26, 2023
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
35fe285
Add mag heading to GPS Rescue heading debug
ctzsnooze 28c6019
Roll and pitch compensated magnetic yaw
pichim d028704
Changes according to PR comments
pichim f403286
Encapsulate yawMag calculations
pichim 85197bc
Corrected naming
pichim 8e87f40
Changes according to PR comments
pichim b330942
Changes so that Checks don't fail
pichim 26a6812
Added PARAM_NAME list
pichim 1a9411b
Changes so that Checks don't fail
pichim 9cede09
Changes according to PR comments
pichim 69dc6e0
Update src/main/fc/parameter_names.h
pichim 05ddf29
Changes according to PR comments
pichim 9af8a30
200Hz compass task
ctzsnooze 80cf572
fix wait status flag
ctzsnooze 65890cb
increase default ODR of HMC5883L to 75Hz
ctzsnooze 0c68430
fix spikes in MagYaw debug by re-calc only on new data
ctzsnooze File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,7 @@ | |
#define HMC_CONFA_POS_BIAS 0x01 | ||
#define HMC_CONFA_NEG_BIAS 0x02 | ||
#define HMC_CONFA_DOR_15HZ 0X10 | ||
#define HMC_CONFA_DOR_75HZ 0x06 | ||
#define HMC_CONFA_8_SAMLES 0X60 | ||
#define HMC_CONFB_GAIN_2_5GA 0X60 | ||
#define HMC_CONFB_GAIN_1_3GA 0X20 | ||
|
@@ -227,7 +228,7 @@ static bool hmc5883lInit(magDev_t *mag) | |
extDevice_t *dev = &mag->dev; | ||
|
||
// leave test mode | ||
busWriteRegister(dev, HMC58X3_REG_CONFA, HMC_CONFA_8_SAMLES | HMC_CONFA_DOR_15HZ | HMC_CONFA_NORMAL); // Configuration Register A -- 0 11 100 00 num samples: 8 ; output rate: 15Hz ; normal measurement mode | ||
busWriteRegister(dev, HMC58X3_REG_CONFA, HMC_CONFA_8_SAMLES | HMC_CONFA_DOR_75HZ | HMC_CONFA_NORMAL); // Configuration Register A -- 0 11 100 00 num samples: 8 ; output rate: 15Hz ; normal measurement mode | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment should probably be: Configuration Register A -- 0 11 110 00 num samples: 8 ; output rate: 75Hz ; normal measurement mode |
||
busWriteRegister(dev, HMC58X3_REG_CONFB, HMC_CONFB_GAIN_1_3GA); // Configuration Register B -- 001 00000 configuration gain 1.3Ga | ||
busWriteRegister(dev, HMC58X3_REG_MODE, HMC_MODE_CONTINOUS); // Mode register -- 000000 00 continuous Conversion Mode | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the declination is negative, eg -5.0 degrees, should this be set as
3550
? Or should we make this value a signed integer and allow negative values?