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

Update max30102_for_stm32_hal.c #7

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

Jiabin-develop
Copy link
Contributor

In the original branch, the sampling rate is not properly set. Also, the shift overwrites other bits in MAX30102_SPO2_CONFIG, which makes the trouble.

It is modified to as below:
void max30102_set_sampling_rate(max30102_t *obj, max30102_sr_t sr)
{
uint8_t config;
max30102_read(obj, MAX30102_SPO2_CONFIG, &config, 1);
config = (config & 0x63) | (sr << MAX30102_SPO2_SR);
max30102_write(obj, MAX30102_SPO2_CONFIG, &config, 1);
}

Copy link
Owner

@eepj eepj left a comment

Choose a reason for hiding this comment

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

Thank you for the PR.

@eepj eepj merged commit 1232284 into eepj:master Aug 19, 2024
@eepj
Copy link
Owner

eepj commented Aug 19, 2024

PR merged. Thanks for the fix.

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.

2 participants