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

added dmpSetFIFOPacketSize #61

Merged
merged 4 commits into from
Dec 12, 2023

Conversation

whyameye
Copy link

@whyameye whyameye commented Sep 19, 2023

I needed this method for when I put my MCU into a deep sleep. The MPU6050 wakes it up via motion detection and I needed it to continue DMP quickly after waking up. dmpInitialize() would have taken too long when this is the only method I needed to resume.

@xpeqex
Copy link
Member

xpeqex commented Sep 26, 2023

Hi @whyameye

Very appreciate you shared this with us and the community.

I have taken a look at it and as it shows in the compilation checks the library will not compile for SAMD21, ESP32, and ESP8266 MCUs, which are a really important part of the boards the community and us use.

After compiling you will receive an error like the following: extra qualification 'MPU6050::' on member 'dmpSetFIFOPacketSize' [-fpermissive]
This means that the compiler is expecting the dmpSetFIFOPacketSize() function to be a member of the MPU6050 class, but the function is actually defined in the global scope.

So my suggestion is to change void MPU6050::dmpSetFIFOPacketSize(uint16_t packetSize); to void dmpSetFIFOPacketSize(uint16_t packetSize); in MPU6050.h file line 1069. I will add the comment to the corresponding file for easier understanding.

Additionally, I would like to test this on my end so please let me know what board/MCU you are using and a code example using this new function.

Thank you for contributing!

@xpeqex
Copy link
Member

xpeqex commented Oct 11, 2023

Hello @whyameye

We would love to add your changes to our library. We have been waiting for your response to this query with the requested changes and the code example so we can test it.

@whyameye
Copy link
Author

I'm under a tight deadline right now but will get back to this in a week or two. I can provide everything you are asking for.

@sabas1080 sabas1080 requested review from sabas1080 and xpeqex December 8, 2023 17:10
@whyameye
Copy link
Author

whyameye commented Dec 8, 2023

I'm happy to write a small sketch to show the use case if you still want this. The short of it is if you put the MCU in a deep sleep but keep the MPU6050 active or cycling the 6050 doesn't need reinitialization but RAM contents for the MCU are lost. So instead of taking the time to reinitialize the 6050 when the MCU wakes up, it's enough to restore the needed RAM for the MCU which pretty-much amounts to setFIFOPacketSize.

src/MPU6050.h Show resolved Hide resolved
@xpeqex
Copy link
Member

xpeqex commented Dec 8, 2023

@whyameye

I want to express our sincere gratitude for your valuable contributions to the library. We truly appreciate your time, effort, and expertise in making the requested changes.

We would also like to take this opportunity to request the example code to check the functionality of this new function. Sharing this code would be immensely helpful for other users.

While an example code for the ESP32, the most commonly used MCU for this library, would be ideal, we would be grateful for any example code you can provide, regardless of the specific MCU it is written for. This way we can work together and add it to the library examples.

Thank you once again for your cooperation and valuable contributions.

@sabas1080 sabas1080 merged commit 52e2b93 into ElectronicCats:master Dec 12, 2023
1 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants