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

samples: maxim_ds3231: increase variable size in min_alarm_handler #65091

Merged

Conversation

CharlesDias
Copy link
Contributor

Change the variable us from uint8_t to uint16_t within the min_alarm_handler function. This update allows the function to correctly handle and print values in the range of 0 to 999.

@zephyrbot zephyrbot added Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. area: Samples Samples area: Counter labels Nov 11, 2023
Copy link

Hello @CharlesDias, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@kartben
Copy link
Collaborator

kartben commented Nov 11, 2023

While the fix looks good (thanks!) I am confused by the printk? It's printing "... seconds.us" so the millisecond part is lost, is it not?

@kartben
Copy link
Collaborator

kartben commented Nov 11, 2023

Ah, nevermind, it's the us variable name that confused me... Should be ms right?

@CharlesDias
Copy link
Contributor Author

Yes, you right! It would be better to change it to ms. Should I add a new commit to change its name, or just add in the previous one and force it?

@kartben
Copy link
Collaborator

kartben commented Nov 11, 2023

Yes, you right! It would be better to change it to ms. Should I add a new commit to change its name, or just add in the previous one and force it?

Good question :) I think it makes sense to have everything squashed into one commit as part of the same "getting milliseconds right" effort. And then force push indeed. Thanks!

Change the variable name from **us** to **ms** and increase its size
to **uint16_t** within the min_alarm_handler function. This update
allows the function to correctly handle the millisecond values in the
range of 0 to 999.

Signed-off-by: Charles Dias <charlesdias.cd@outlook.com>
@CharlesDias
Copy link
Contributor Author

Done. Thanks!

@nashif nashif merged commit c9e6ac5 into zephyrproject-rtos:main Nov 13, 2023
13 checks passed
Copy link

Hi @CharlesDias!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

@CharlesDias CharlesDias deleted the fix_variable_size_maxim_ds3231 branch February 21, 2024 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Counter area: Samples Samples Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants