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

drivers/sensors: Remove unnecessary heap allocation for bmi270 #10542

Merged
merged 2 commits into from Sep 8, 2023

Conversation

SPRESENSE
Copy link
Contributor

Summary

Remove temporary heap allocation and fix memory leak.
Add spresense board-specific driver for bmi270.

Impact

bmi270 sensor

Testing

Copy link
Contributor

@raiden00pl raiden00pl left a comment

Choose a reason for hiding this comment

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

This shouldn't be merged. Some chips can't do DMA transfer from FLASH and therefore it is necessary to transfer the configuration file to RAM (all Nordic chips).

We can make this configurable from Kconfig - send from heap or not.

@SPRESENSE
Copy link
Contributor Author

@raiden00pl
Thanks for your comment. I agree with making it configurable with Kconfig.
In the original implementation, there was no free, is this just a mistake?

@raiden00pl
Copy link
Contributor

Thanks for your comment. I agree with making it configurable with Kconfig.
In the original implementation, there was no free, is this just a mistake?

Yes, that's a mistake. We should free after the configuration transfer.

Allow to transfer the BMI270 configuration data directly, and
provide an option to use the heap memory if it cannot transfer
directly.
@SPRESENSE
Copy link
Contributor Author

I added a Kconfig to use heap memory or not. please review.

Copy link
Contributor

@raiden00pl raiden00pl left a comment

Choose a reason for hiding this comment

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

lgtm

@xiaoxiang781216 xiaoxiang781216 merged commit 60364d7 into apache:master Sep 8, 2023
24 of 26 checks passed
@jerpelea jerpelea added this to To-Add in Release Notes - 12.3.0 Sep 26, 2023
@jerpelea jerpelea moved this from To-Add to drivers in Release Notes - 12.3.0 Sep 27, 2023
@jerpelea jerpelea moved this from drivers to done in Release Notes - 12.3.0 Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants