Skip to content
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_BattMonitor: make INA3221 parameters visible for metadata gen #28852

Merged
merged 3 commits into from
Dec 14, 2024

Conversation

tpwrules
Copy link
Contributor

Not sure if more files need to be added for other battery monitor types? I suppose as long as the file list has the union of all possible parameters... It doesn't look like the metadata generator deduplicates anyway, c.f. BATTn_I2C_BUS.

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, should have spotted this on the original PR. The new monitors param indexes conflict with the AD7091 eg:

// Param indexes must be 56 to 61 to avoid conflict with other battery monitor param tables loaded by pointer

// Param indexes must be between 56 and 61 to avoid conflict with other battery monitor param tables loaded by pointer

One of the odd things about battery monitor is that all the backends are loaded as though they share and single param table so none the params in the sub tables can use the same index. It seemed link a nice simplification at the time but now were running out of indexes.....

@tpwrules
Copy link
Contributor Author

I thought all monitors were supposed to use the same index range cause only one would be active at a time?

Hopefully makes it less likely for conflicts to happen and makes it
easier to find free indices.
Hasn't been released yet so let's not add more conflicts.
@tpwrules
Copy link
Contributor Author

Reallocated the indices and fixed up to make a conflict hopefully less likely in the future. It seems we are still decent on absolute count for a while yet as long as we do not allocate blocks.

Needs to be backported to 4.6 now so the INA3221 IDs do not desync.

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@peterbarker peterbarker merged commit 2f5be28 into ArduPilot:master Dec 14, 2024
99 checks passed
@tpwrules tpwrules deleted the pr/ina3221-params branch December 14, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Pending
Development

Successfully merging this pull request may close these issues.

4 participants