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/mpu9x50: clean up code #19657

Merged
merged 1 commit into from
May 24, 2023
Merged

drivers/mpu9x50: clean up code #19657

merged 1 commit into from
May 24, 2023

Conversation

maribu
Copy link
Member

@maribu maribu commented May 23, 2023

Contribution description

Avoid using floating point arithmetic and some minor cleanups.

Testing procedure

make BOARD=msbiot -C examples/default flash term

Output with master

> 2023-05-23 21:40:13,551 # main(): This is RIOT! (Version: 2023.07-devel-420-geb10a)
2023-05-23 21:40:13,553 # Welcome to RIOT!
> saul read 5
2023-05-23 21:40:16,845 # saul read 5
2023-05-23 21:40:16,849 # Reading from #5 (mpu9x50|SENSE_ACCEL)
2023-05-23 21:40:16,852 # Data:	[0]         -25 mgₙ
2023-05-23 21:40:16,854 # 	[1]         -36 mgₙ
2023-05-23 21:40:16,856 # 	[2]         998 mgₙ
> saul read 6
2023-05-23 21:40:20,102 # saul read 6
2023-05-23 21:40:20,106 # Reading from #6 (mpu9x50|SENSE_GYRO)
2023-05-23 21:40:20,109 # Data:	[0]         0.0 dps
2023-05-23 21:40:20,110 # 	[1]         0.2 dps
2023-05-23 21:40:20,112 # 	[2]         0.0 dps
> saul read 7
2023-05-23 21:40:22,715 # saul read 7
2023-05-23 21:40:22,719 # Reading from #7 (mpu9x50|SENSE_MAG)
2023-05-23 21:40:22,721 # Data:	[0]        0.10 Gs
2023-05-23 21:40:22,723 # 	[1]        0.01 Gs
2023-05-23 21:40:22,725 # 	[2]        0.75 Gs

Output with this PR

> 2023-05-23 21:40:28,155 # main(): This is RIOT! (Version: 2023.07-devel-420-geb10a-mpu9x50-no-float)
2023-05-23 21:40:28,156 # Welcome to RIOT!
> saul read 5
2023-05-23 21:40:29,587 # saul read 5
2023-05-23 21:40:29,591 # Reading from #5 (mpu9x50|SENSE_ACCEL)
2023-05-23 21:40:29,594 # Data:	[0]        1296 mgₙ
2023-05-23 21:40:29,596 # 	[1]        1796 mgₙ
2023-05-23 21:40:29,598 # 	[2]         660 mgₙ
> saul read 6
2023-05-23 21:40:30,902 # saul read 6
2023-05-23 21:40:30,906 # Reading from #6 (mpu9x50|SENSE_GYRO)
2023-05-23 21:40:30,909 # Data:	[0]       -15.3 dps
2023-05-23 21:40:30,910 # 	[1]        67.1 dps
2023-05-23 21:40:30,912 # 	[2]       -13.7 dps
> saul read 7
2023-05-23 21:40:32,535 # saul read 7
2023-05-23 21:40:32,539 # Reading from #7 (mpu9x50|SENSE_MAG)
2023-05-23 21:40:32,542 # Data:	[0]        0.12 Gs
2023-05-23 21:40:32,543 # 	[1]        0.01 Gs
2023-05-23 21:40:32,545 # 	[2]        0.76 Gs

Issues/PRs references

#19614

Avoid using floating point arithmetic and some minor cleanups.
@maribu maribu added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 23, 2023
@github-actions github-actions bot added the Area: drivers Area: Device drivers label May 23, 2023
@maribu
Copy link
Member Author

maribu commented May 23, 2023

This yields a major reduction in .text (~2.5 KiB safed), RAM consumption is unchanged.

Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

Code looks good and output is given.

ACK

@riot-ci
Copy link

riot-ci commented May 23, 2023

Murdock results

✔️ PASSED

533af18 drivers/mpu9x50: clean up code

Success Failures Total Runtime
6933 0 6933 10m:42s

Artifacts

@benpicco
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented May 24, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 40d0f64 into RIOT-OS:master May 24, 2023
@maribu maribu deleted the mpu9x50-no-float branch May 24, 2023 19:07
@maribu
Copy link
Member Author

maribu commented May 24, 2023

Thx :)

@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants