-
Notifications
You must be signed in to change notification settings - Fork 17.3k
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
AP_Compass: Add in BMM350 Driver #26987
Conversation
c618911
to
654620c
Compare
@tridge Can you check it? It will be used in CUAV's new flight controller. |
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.
I haven't checked this against the data sheet, but it looks pretty good structure-wise.
Have you got logs of this with other existing compasses to compare it against? How else have you tested this compass?
@@ -515,7 +516,7 @@ const AP_Param::GroupInfo Compass::var_info[] = { | |||
// @Param: DISBLMSK | |||
// @DisplayName: Compass disable driver type mask | |||
// @Description: This is a bitmask of driver types to disable. If a driver type is set in this mask then that driver will not try to find a sensor at startup | |||
// @Bitmask: 0:HMC5883,1:LSM303D,2:AK8963,3:BMM150,4:LSM9DS1,5:LIS3MDL,6:AK09916,7:IST8310,8:ICM20948,9:MMC3416,11:DroneCAN,12:QMC5883,14:MAG3110,15:IST8308,16:RM3100,17:MSP,18:ExternalAHRS | |||
// @Bitmask: 0:HMC5883,1:LSM303D,2:AK8963,3:BMM150,4:LSM9DS1,5:LIS3MDL,6:AK09916,7:IST8310,8:ICM20948,9:MMC3416,11:DroneCAN,12:QMC5883,14:MAG3110,15:IST8308,16:RM3100,17:MSP,18:ExternalAHRS,21:BMM350 |
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.
Shouldn't you use 19 here?
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.
19:MMC5XX3,20:QMC5883P
seems to be missing here, should I complete it?
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.
A follow-up PR would be good :-)
Thanks to the developers for your reviews and suggestions, I will modify it based on your suggestions. |
654620c
to
00ab0f7
Compare
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.
This looks good.
Thanks for providing the testing data.
Marking for discussion at DevCallEU tonight
@@ -515,7 +516,7 @@ const AP_Param::GroupInfo Compass::var_info[] = { | |||
// @Param: DISBLMSK | |||
// @DisplayName: Compass disable driver type mask | |||
// @Description: This is a bitmask of driver types to disable. If a driver type is set in this mask then that driver will not try to find a sensor at startup | |||
// @Bitmask: 0:HMC5883,1:LSM303D,2:AK8963,3:BMM150,4:LSM9DS1,5:LIS3MDL,6:AK09916,7:IST8310,8:ICM20948,9:MMC3416,11:DroneCAN,12:QMC5883,14:MAG3110,15:IST8308,16:RM3100,17:MSP,18:ExternalAHRS | |||
// @Bitmask: 0:HMC5883,1:LSM303D,2:AK8963,3:BMM150,4:LSM9DS1,5:LIS3MDL,6:AK09916,7:IST8310,8:ICM20948,9:MMC3416,11:DroneCAN,12:QMC5883,14:MAG3110,15:IST8308,16:RM3100,17:MSP,18:ExternalAHRS,21:BMM350 |
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.
A follow-up PR would be good :-)
{ | ||
uint8_t data[read_len + 2]; | ||
|
||
if (!_dev->read_registers(reg, data, read_len + 2)) { |
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 (!_dev->read_registers(reg, data, read_len + 2)) { | |
if (!_dev->read_registers(reg, data, ARRAY_SIZE(data))) { |
while (boot_retries--) { | ||
// Soft reset | ||
if (!_dev->write_register(BMM350_REG_CMD, BMM350_CMD_SOFTRESET)) { | ||
continue; |
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.
No delay in this case. Not sure if that's a problem or not.
I've created a separate PR wuith the commits appropriately split as I could not force-push your branch. Thanks for this contribution! |
No description provided.