juliangaal / mpu6050

MPU6050 embedded-hal driver written in Rust
https://crates.io/crates/mpu6050
MIT License
52 stars 31 forks source link

Add configuration options #51

Open massimiliano-mantione opened 2 years ago

massimiliano-mantione commented 2 years ago

Hi, 1st of all, thanks for this driver :-)

While making it work (and comparing it to the C Adafriut driver for Arduino platforms), I noticed that a few configuration capabilities were missing or not explicit.

This PR adds them, one per commit. However, an initial commit applies rustfmt because in my environment it happens automatically and I did not want to disable it. I understand that ideally this should stay in a separated PR but being in a separated commit the code review is doable anyway :-) If you are really opposed to using rustfmt (and always complying to its style) I can rewrite the PR without it.

Thanks!

massimiliano-mantione commented 2 years ago

Note: I tested this on a bare metal cortex-m (and RP2040 board). Everything works as expected.

juliangaal commented 2 years ago

Thanks for the PR!

I am not sure how to handle this PR to be honest. I will not be able to work on this driver before the end of November, when I have completed my thesis. On the other hand, the version on crates.io will stay unchanged.

Can you understand my hesitation to merge into master, without being able to test myself?

massimiliano-mantione commented 2 years ago

Of course, do not worry! I can always reference my fork from my cargo builds :-)