Skip to content

Left-shift instead of right-shift when setting sample rate #109

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

Closed
yanivamichy opened this issue Jan 12, 2023 · 1 comment · Fixed by #110
Closed

Left-shift instead of right-shift when setting sample rate #109

yanivamichy opened this issue Jan 12, 2023 · 1 comment · Fixed by #110

Comments

@yanivamichy
Copy link

yanivamichy commented Jan 12, 2023

Hi, while configuring my sensor I noticed the following:
Inside ICM_20948_set_sample_rate the high bytes are taken by left shifting instead of right shifting (in line 795 of ICM_20948_C.c)
"uint8_t div1 = (smplrt.a << 8);"

these bytes are almost always zero so it mostly won't matter, but it is an instant fix anyhow.
yaniv.

@PaulZC
Copy link
Contributor

PaulZC commented Jan 12, 2023

Hi Yaniv (@yanivamichy ),

Excellent find - thank you.

Very best wishes,
Paul

PaulZC added a commit that referenced this issue Jan 12, 2023
@PaulZC PaulZC linked a pull request Jan 12, 2023 that will close this issue
PaulZC added a commit that referenced this issue Jan 12, 2023
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 a pull request may close this issue.

2 participants